ActiveMQ - delete/purge all queue via command line

As of version 5.0 it looks like this can be done using the CLI provided with ActiveMQ itself:

$ ActiveMQ/bin/activemq purge

I developed my own ActiveMQ command line utility (activemq-cli) to do this. You can find it here: https://github.com/antonwierenga/activemq-cli (command 'purge-all-queues' or 'remove-all-queues').


You can do tweak your activemq.xml a bit:

<broker deleteAllMessagesOnStartup="true"  ...>

This works with KahaDB message stores (it has problems with JDBC message stores), all your messages get deleted and subsequently queues are cleared.

As you want all queues to be deleted, restarting the broker won't be a costly option to clean everything up.

The purge will happen on 'every' restart