Cristian Boariu
Cristian Boariu

Reputation: 9621

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.

Upvotes: 2

Views: 4693

Answers (3)

al.
al.

Reputation: 717

If you're going to solve it via SQL, at least make sure the Queues are unbound at the time and restrict it to the Dead Letter Queue like so:

delete from jms_messages where destination = 'DLQ';

Upvotes: 1

pra
pra

Reputation: 8629

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.

Upvotes: 2

Cristian Boariu
Cristian Boariu

Reputation: 9621

Solved: There is a jbossdb database:

delete  FROM jms_messages ;

Upvotes: 0

Related Questions