You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Kevin Burton <bu...@spinn3r.com> on 2014/10/25 05:41:53 UTC

Deleting all queues and messages in those queues for unit tests and embedded broker?

What’s the best way to delete all queues and messages in those queues.

Basically, I want a fresh broker, it’s unclear whether purge() in the JMS
just empties the queue or whether it also removes the queue too.

-- 

Founder/CEO Spinn3r.com
Location: *San Francisco, CA*
blog: http://burtonator.wordpress.com
… or check out my Google+ profile
<https://plus.google.com/102718274791889610666/posts>
<http://spinn3r.com>

Re: Deleting all queues and messages in those queues for unit tests and embedded broker?

Posted by artnaseef <ar...@artnaseef.com>.
Purge just discards messages, which is likely sufficient for your case. 
Although it sometimes does not delete messages - perhaps those that are
in-flight?

For unit tests, creating a fresh broker instance each time using
BrokerService eliminates the risk of side-effects from prior runs.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Deleting-all-queues-and-messages-in-those-queues-for-unit-tests-and-embedded-broker-tp4686705p4686706.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.