Search code examples
javajbossjmsjbossmq

clear jBoss DLQ


Does anyone know how to clear DeadLetterQueue from jBoss? When i start jBoss, it is waiting 4 minutes at:

12:09:06,281 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'

and other 4 min at:

 [DLQ] () Bound to JNDI name: queue/DLQ

and i think that probably i have to clear this queue..but it is not inside jBoss...?

Can anybody give a hand of help?

thanks in advance.


Solution

  • The answer you found will remove messages from all queues, which is not always desirable.

    You can also accomplish the same via jmx, by invoking removeAllMessages() on the jboss.mq.destination:name=DLQ;service=Queue mbean.

    Or you can eliminate the need to manually flush your DLQ at all -- in conf/jboss-service.xml, add <TimeToLive>86400000</TimeToLive> to the <DLQConfig> element. That will expire messages after 1 day.