[jboss-user] [JBoss Messaging] - Reprocess DLQ

ansur do-not-reply at jboss.com
Wed Mar 13 10:51:20 EDT 2013

ansur [https://community.jboss.org/people/ansur] created the discussion

"Reprocess DLQ"

To view the discussion, visit: https://community.jboss.org/message/802383#802383

There have been some topics on removing messages from DLQ - which doesn't seem like something easy to accomplish with JMS.

The requirement that I have is that we need to enable users to reprocess a DLQ.
My current implementation boils down to the following snippet:

                final QueueBrowser browser = session.createBrowser(queue);
                final Enumeration<Message> jmsMessages = browser.getEnumeration();
                while(jmsMessages.hasMoreElements()) {
                    final Message jmsMessage = jmsMessages.nextElement();
                    final Destination destination = jmsMessage.getJMSDestination();
                    sendMessage(jmsMessage, destination, session);

I.e. create a browser, and for each message, get the destination and send it there. the sendMessage() method creates a MessageProducer and calls the send() method.

This is working fine, but the message isn't actually removed from the DLQ.
What behaviour would I need in order to have it removed after processing?

After all, if the message fails to process again, it would just en dup in the DLQ again - which is OK.

Finally, the above is part of a manual action. So I can't just register an MDB on the DLQ - it needs to be a manual invocation.

Reply to this message by going to Community

Start a new discussion in JBoss Messaging at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130313/bbaf619b/attachment.html 

More information about the jboss-user mailing list