You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by micha <mi...@ww-informatik.de> on 2011/04/22 13:16:09 UTC

Forcing processing of a queue and wait until empty

Hi all,

we have switched to activemq and we are using automated webtests. Some of
these tests put messages in a queue and we have to wait for these messages
to be processed before we can go on with the tests.

Messages gets redelivered on failures. Currently I use jmx in a loop with a
sleep and assume that it failed if the queue not gets empty within a period
of time.

Now the question is if there exists a better way. Such as a way to force the
processing of a queue (and gets information if the processing has failed) in
order to speed up the tests?

Regards

Michael


--
View this message in context: http://activemq.2283324.n4.nabble.com/Forcing-processing-of-a-queue-and-wait-until-empty-tp3467782p3467782.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Forcing processing of a queue and wait until empty

Posted by Aleksandar Ivanisevic <al...@ivanisevic.de>.
micha <mi...@ww-informatik.de> writes:

> Messages gets redelivered on failures. Currently I use jmx in a loop with a
> sleep and assume that it failed if the queue not gets empty within a period
> of time.

if you set the expiry on the messages you can assume that all messages
will be "processed" one way or the other by the expiry time.

> Now the question is if there exists a better way. Such as a way to
> force the

if you have the web interface enabled you can fetch the queues page
and parse that in a shell script, it will be faster and less resource
consuming than firing up a JVM for each peek in the queue.

> processing of a queue (and gets information if the processing has failed) in
> order to speed up the tests?

only consumers can "force the processing" by consuming, ActiveMQ can't
force the consumers to do anything, how would it, anyway?

-- 
Ti si arogantan, prepotentan i peglaš vlastitu frustraciju. -- Ivan
Tišljar, hr.comp.os.linux