5 Replies Latest reply on Apr 14, 2005 12:06 PM by bjordan

    How to Remove a message from the DLQ

    bjordan

      I am writing a thread that will go to the Dead Letter Queue and pop messages off and put them back on their original queue. I don't know how to get the messages off the DLQ. I can browse them using a QueueBrowser but that will not remove them. Does anyone know how to remove an existing message from the DLQ?

        • 1. Re: How to Remove a message from the DLQ

          The same way you would from any other queue.

          • 2. Re: How to Remove a message from the DLQ
            bjordan

            That does not help at all. The way you get a message from any other queue is to create an MDB and register as a listener for that queue. I'm making a thread that starts up every hour and takes all the messages off the DLQ and tries to deliver them back to their original destination queue. I can't seem to start the thread, register as a listener and have the DLQ dump me it's messages. To this point I can only see the messages using the QueueBrowser. When I register as a listener in my Thread I don't get any messages although I can see that there are several in there. Currently I have tried to register as a QueueConsumer in my Thread, set the consumers listener but the consumer is never notified in the receive() method even though there are several messages that have been in the DLQ for a while. How do I remove a message from the DLQ so I can send it back to its origianl destination queue using a Thread on a timer and not just registering some MDB that will receive DLQ messages as soon as they arrive? I'm thinking that I register and unregister this MDB when the thread starts but that doesn't seem to work either!

            • 3. Re: How to Remove a message from the DLQ
              starksm64

              Go to the queue example on the wiki and point the example to the DLQ.

              • 4. Re: How to Remove a message from the DLQ
                anil.saldhana

                A wiki page was created sometime ago that addresses this:

                http://www.jboss.org/wiki/Wiki.jsp?page=DeadLetterQueues

                • 5. Re: How to Remove a message from the DLQ
                  bjordan

                  Thanks guys, that was very helpful. I had just forgot to call start() on my QueueConnection and that is why I was not getting any messages. Once I did that everything started working as it should. I appreciate your quick responses and effort in getting me back on track! Once I looked at the example you pointed me to I figured out the problem immediately. Thanks again!