-
1. How to browse the DLQ?
esbexpert Apr 8, 2011 4:46 AM (in response to alansmanne)I could guess the problem could be in the transaction.
Some visual tools can show the uncommitted messages in UOW too.
Classical JMS code will not show you the uncommitted messages.
Check the configuration of your JBoss regarding XA, or transaction model.
-
2. Re: How to browse the DLQ?
balaalwayz Aug 25, 2011 5:52 AM (in response to alansmanne)Hi,
I would like to know whether the ServiceLocator used in the program is a API class or a user defined class? -
3. Re: How to browse the DLQ?
alansmanne Aug 25, 2011 6:02 AM (in response to balaalwayz)It's a custom class. Basically, it's just a wrapper around the InitialContext, with some cache to avoid useless requests.
We never solved this problem, but we managed to track all errors and use a custom logging system to trace every message sent and read from/to the Queue
-
4. Re: How to browse the DLQ?
balaalwayz Aug 25, 2011 6:34 AM (in response to alansmanne)Thanks Aurelien for your quick reply.
Could you please share that code. Actually we are using seam to instantiate queue sender to send messages to the queue or is there any other way to instantiate the queue?
Basically my requirement is to delete the messages from the DLQ.We are using default DLQ to handle the failure messages.Once the message reaches DLQ, it will be persistented in the DB. we are using Oracle for persistence. I am able to see the Jboss tables and the messages in our oracle DB .
Now i can do two actions.
1) Browse all the messages
2) Delete the message from DLQ, which should eventually delete the from DB as well.
How can i achieve this tasks? Please let me know if you need any clarifications!
-
5. Re: How to browse the DLQ?
alansmanne Aug 25, 2011 7:19 AM (in response to balaalwayz)I'm sorry but I can't share all my code.
Queue queue = ServiceLocator.getInstance().getQueue("queue/myQueue");
is the same as
context.lookup("queue/myQueue");
Where "queue/remoteNotifQueue" is defined in jbossmq-destinations-service.xml
<mbean code="org.jboss.mq.server.jmx.Queue"
name="jboss.mq.destination:service=Queue,name=myQueue">
<depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
<depends optional-attribute-name="SecurityManager">jboss.mq:service=SecurityManager</depends>
<attribute name="MessageCounterHistoryDayLimit">-1</attribute>
<attribute name="SecurityConf">
<security>
<role name="guest" read="true" write="true" create="true"/>
</security>
</attribute>
</mbean>
The DLQ is stored using an hsql local database. If you can connect to this local database, you should be able to browse the DLQ with a simple query :
SELECT messageid FROM jms_messages WHERE destination = 'QUEUE.DLQ'
The configuration file is hsqldb-ds.xml in jbossdir/server/xxxx/deploy/
The default datasource name is <jndi-name>DefaultDS</jndi-name>
So you should be able to connected using something like
dataSource = (DataSource) context.lookup("java:/DefaultDS");
dataSource.createConnection().createStatement(...
-
6. Re: How to browse the DLQ?
balaalwayz Aug 25, 2011 7:26 AM (in response to alansmanne)Hi Aurelien,
Thats fine.
If i want to delete the messages from the DLQ, is there any API do that, or i need to delete the messages manually(creating a db connection and using prepared statements) from the DB?
-
7. Re: How to browse the DLQ?
alansmanne Aug 25, 2011 7:29 AM (in response to balaalwayz)The manual database deletion was the only solution that worked for us. Maybe there are alternatives on Jboss versions > 4.2.2.