[jboss-user] [JBoss Messaging] - How to browse the DLQ?

Aurélien Lansmanne do-not-reply at jboss.com
Fri Feb 4 05:26:47 EST 2011

Aurélien Lansmanne [http://community.jboss.org/people/alansmanne] created the discussion

"How to browse the DLQ?"

To view the discussion, visit: http://community.jboss.org/message/585449#585449


I've been trying to read the messages from the Jboss DLQ for some times... but without success.

First, i've tried to use a QueueBrowser. I thought it could display the messages in the DLQ as they are stuck there and never received by any client.

Queue DLQueue = ServiceLocator.getInstance().getQueue("queue/DLQ");
QueueConnectionFactory queueConnectionFactory = ServiceLocator.getInstance().getQueueConnectionFactory("ConnectionFactory"); //Service locator is a wrapper that does (QueueConnectionFactory) context.lookup("qConnFactoryName")
QueueConnection queueConnection = queueConnectionFactory.createQueueConnection();
QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

QueueBrowser DLQBrowser = queueSession.createBrowser(DLQueue);
Enumeration<?> dlqEnum = DLQBrowser.getEnumeration();

while (dlqEnum.hasMoreElements()) {
       Object object = dlqEnum.nextElement();
       // Do something with object

But the enumeration is empty... 

I've also tried to use the JMX-console. When I click on name=DLQ,service=Queue, then listMessageCounter(), i can see that there are indeed 100 messages in the DLQ. But when I try to browse them :

* listScheduledMessages() : empty ...
* listMessages() : empty...
* listInProcessMessages() : empty...

Then, I tried to open the HSQL database myself with DBVisualizer to browse the JMS_MESSAGES table. But I was only able to see some messages IDS, but not the message itself.

My last option is to use a Message Listener on the DLQ and do all the business to store them somewhere I can easily access... if I can't use any of the previous options.

Any help is appreciated. 

Aurélien Lansmanne.

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/20110204/dee46bed/attachment.html 

More information about the jboss-user mailing list