activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amp834 <>
Subject Re: How to tell if everything in a queue has been processed
Date Thu, 10 Sep 2009 13:38:32 GMT

Hi Rob, & thanks for the info.

That post references a doc that I can't find,

I'm not sure if the bean mentioned in
gives the messages that have been "not committed/consumed yet" (if a message
has been delivered, but the client has not yet committed, I need to count
that as "still unfinished")

The original post also mentions "Or you can just grab a reference to the
ActiveMQ Broker object itself and navigate that if you are in the same
Is there something simple I can do to a broker to make it realize when a
queue has become empty and have it send a message?  (I would need it to test
if some "TestForEoq" flag is enabled; I would disable it while writing tasks
to the queue). 

Alternately, I can write a "test for end of queue" message at the end of
writing all the tasks for a queue, and whoever consumes that message would
check the queue, if it's not empty, write another "test for end of queue"
message (preferably with a "delayed delivery", if ActiveMq allows that now;
JBOSS seems to allow delayed delivery of individual messages, but I haven't
found anything simple in ActiveMq).

I'm new to ActiveMq, and am not sure what paths are easiest.  Any help would
be greatly appreciated!

rajdavies wrote:
> On 9 Aug 2009, at 15:32, amp834 wrote:
>> I'm using ActiveMQ to "Submit a job" to queue "Job53" (a queue for  
>> each job),
>> with (say) 500 subtasks, and want to know when the 500 items have been
>> processed completely.  I thought of creating a queue just for that  
>> job,
>> writing 500 messages to it, and when the 500 messages have been  
>> processed,
>> the job is done.
>> Is there a way to tell if a queue is empty?  (no messages in the  
>> queue, no
>> messages that a consumer has taken but has not finished processing)?
>> I found an old post, but it's so old that I thought I'd ask the  
>> question
>> again.
>> -- 
>> View this message in context:
>> Sent from the ActiveMQ - User mailing list archive at
> You can either use JMX - as the old post suggested - or enable message  
> consumed advisory - to get informed out when a message has been  
> consumed from the queue - see
> cheers,
> Rob
> Rob Davies
> I work here:
> My Blog:
> I'm writing this:

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

View raw message