JBoss Community

How to browse the DLQ?

created by Aurélien Lansmanne in JBoss Messaging - View the full discussion

Hello,

 

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

}

queueConnection.close();

 

 

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