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.
I would like to know whether the ServiceLocator used in the program is a API class or a user defined class?
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
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!
I'm sorry but I can't share all my code.
Queue queue = ServiceLocator.getInstance().getQueue("queue/myQueue");
is the same as
Where "queue/remoteNotifQueue" is defined in jbossmq-destinations-service.xml
<role name="guest" read="true" write="true" create="true"/>
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");
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?
The manual database deletion was the only solution that worked for us. Maybe there are alternatives on Jboss versions > 4.2.2.