activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From corcorda <>
Subject programmatically purging all queues
Date Tue, 11 Sep 2007 14:46:42 GMT


I'm looking for a way to iterate over all queues matching a certain pattern
and removing all messages from them. 

I'm using ActiveMQ for several different software environments and when a
particular environment is restarted it needs to purge its queue. Each queue
looks like "environment_name.task_name.etc". When an environment is started
I want to purge (or remove) all queues/messages below "environment_name".

I know you can call purge on a destination and also the following page
explains that you can get a list of destinations:
but I'm struggling to put the code together. Any help would be great.

The broker is remote and I'm using ActiveMQ 4.1.1

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message