4 Replies Latest reply on Oct 15, 2005 4:55 PM by tomdee

    Re-sending messages from the DLQ

    M Cantrell Newbie

      Is it possible re-send messages in the existing DLQ?

      For instance, the network connection may be down for an extended period of time (longer than the MDB's configured RedeliveryDelay and RedeliveryLimit) and the messages start making their way to the DLQ. Once my network connection is back, I want to re-send messages in the DLQ to their original queue.

      The blurb in the wiki states:

      The best approach is to deploy an MDB that handles messages appearing in the DLQ, e.g. 1) Send messages to admin/tech support 2) Stores the message somewhere for debugging purposes


      indicating a need for a custom DLQ handler but the line at the bottom states:

      Normally, the messages can be reposted to the original queue, once the problem is resolved.


      Indicating an ability to re-send somehow. I see the removeAllMessages() and listMessages() methods in the JMX console but nothing for resending. If I am confused, I apologize but I find the two statements somewhat conflicting.

        • 1. Re: Re-sending messages from the DLQ
          Elias Ross Master

           

          "subvert" wrote:
          Is it possible re-send messages in the existing DLQ?



          Create an MDB (transacted) that parses the Message property DLQHandler.JBOSS_ORIG_DESTINATION and creates a QueueSender, then sends the message to this queue.

          There are no JMX controls for this.


          • 2. Re: Re-sending messages from the DLQ
            M Cantrell Newbie

            So, one solution is to replace the queue's DLQ with a custom MDB and resend the Message to the original queue. I really don't like the idea of getting caught in an endless loop sucking up bandwidth and other resources.

            I guess I will have to create a DLQ MDB which persists the messages to a different table. Then my users can edit, resend messages arbitrarily. I was hoping to avoid this because this project will be placed at hundreds (maybe thousands) of remote locations. I'm trying to keep everything as small as possible for logistics reasons.

            I had also played around with the idea of using QueueBrowser to inspect, edit and resend messages. That would work fine except I don't think there's a good way to delete individiual messages (I'd need to remove the message from the DLQ after it was resent). If there is a way to delete messages, I'd be very interested in using this approach.

            • 3. Re: Re-sending messages from the DLQ
              Elias Ross Master


              You can programmatically stop/start delivery of messages in an MDB. Look at the JMX console under (jboss.j2ee). So, you could keep in in the stop position, and then an operator could resend them later.

              • 4. Re: Re-sending messages from the DLQ
                tomdee Newbie

                 

                "genman" wrote:

                You can programmatically stop/start delivery of messages in an MDB. Look at the JMX console under (jboss.j2ee)


                is there a way the define the queue in such a way that when JBoss starts up, the delivery mechanism is NOT started? And programmatically, we can start the the delivery later (programmatically or via console) ?

                Thanks