You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Balakumar Narayanasamy <ba...@gmail.com> on 2006/08/17 06:55:21 UTC

How to clear queue other than pulling out the message

I am using ActiveMQ 4.0.1 for my application. My application has two parts.
one part used to push messages in to queue which is pretty fast and other
one pulls message and generate PDF which is slow compartively. There is
scenario where in lots of messages are available in queue and my application
crashes due to some other reason not relative to ActiveMQ. In certain
condition, i have clear the queue. Right now i am pulling messages out of
the queue simply. This take time when there are more number of message are
available. Is there is any of clearing queue faster other than pulling out
message or deleting the existing queue and extracting again from source
file. Note:- I am using persistent Queue.
-- 
View this message in context: http://www.nabble.com/How-to-clear-queue-other-than-pulling-out-the-message-tf2119572.html#a5845531
Sent from the ActiveMQ - User forum at Nabble.com.


Re: How to clear queue other than pulling out the message

Posted by John Heitmann <jh...@gmail.com>.
On Aug 16, 2006, at 9:55 PM, Balakumar Narayanasamy wrote:
> Is there is any of clearing queue faster other than pulling out
> message or deleting the existing queue and extracting again from  
> source
> file. Note:- I am using persistent Queue


There's a purge() method available on queues that is exposed via JMX.  
It will purge all messages not in prefetch buffers. In your case if  
your consumers are dead then you will have no outstanding messages in  
prefetch, so it should clear all of them.

John