There's a new plugin in trunk for the broker that you can send a
message to to ask statistics on a Destination (Topic or Queue) - and
it will send back a MapMessage with the stats in. If you can't wait a
while for the 5.3 release - which should be soon - it you can use that.
On 10 Sep 2009, at 16:39, amp834 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).
--
View this message in context:
http://www.nabble.com/How-to-tell-if-everything-in-a-queue-has-been-processed-tp24887648p25385340.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Rob Davies
I work here: http://fusesource.com
My Blog: http://rajdavies.blogspot.com/
I'm writing this: http://www.manning.com/snyder/