activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Snyder <bruce.sny...@gmail.com>
Subject Re: How to tell if everything in a queue has been processed
Date Fri, 11 Sep 2009 23:13:27 GMT
On Thu, Sep 10, 2009 at 9:39 AM, amp834 <amp834@rqinc.com> wrote:
>
>
>
>>messages are sent to another queue to indicate that a job/message has been
> processed. By sending a
> message to a different queue upon completion of such processing, the client
> can poll for messages on that queue and know immediately when the processing
> is complete.
>
> Thanks for the suggestions, Bruce.  I thought of doing something like that,
> having a "job monitor" receive messages from a "completed" queue and update
> the # of tasks that were finished.  That would add more complexity:  every
> time a task has been added to the queue, I would have to update the job
> monitor's database to tell it about the new task (I could, whenever I
> "write" a task item to a queue, write messages to two queues, one to be
> consumed by the processing machines, and one for the job monitor).  The job
> monitor would have to make sure its counters are stored safely, in case of a
> crash.
>
> A simple "is the queue empty" would eliminate all of this extra traffic and
> overhead!
>
> With the "send messages when you finish an item" method, are you thinking of
> something simple that I'm not catching on to?
>
> The net effect of what I'm trying to do is to...
> submit a "job" that consists of several subtasks, the subtasks can also add
> more subtasks to that job's queue, and to know when there is no subtask left
> (it can send a message to an admin queue).

Allowing a client to query the server is a client/server style of
design whereas the use of asynchronous messaging is a messaging style
of design. Message brokers don't typically provide the ability to be
queried unless it's through a management interface such as JMX.
However, as Rob suggests, there is a plugin that he created this week
to grab destination stats via standard messaging.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

ActiveMQ in Action: http://bit.ly/2je6cQ
Blog: http://bruceblog.org/
Twitter: http://twitter.com/brucesnyder

Mime
View raw message