[rabbitmq-discuss] Learning of the last job on queue.

Allan Kamau kamauallan at gmail.com
Sun Apr 17 14:10:54 BST 2011

I would like to know if the current job just processed is indeed the
last job of a new empty queue.

I have a requirement to process jobs level wise and there are n number
of levels where n may not be known before hand.
The current queue may only contain jobs of a common "level" and the
process of populating this queue with jobs of a given "level" should
happen once.
The fetching and processing of these jobs in the queue is done by
several clients, each client will record it's most recent job in some
internal variable.

When all the jobs in the queue are processed (by multiple clients) and
no more jobs remain (and any of the client's
Consumer.nextDelivery(long l) returns null)  I would like any of these
clients (which should have previously fetched an processed a job from
the queue) to somehow query and know the id or copy of the last job on
the given queue, and compare it with their most recent acquired and
processed job.
Then the client which has a match of this last job against it's most
recently processed job will have a go at populating the queue with the
next level of jobs.

Is there some way of knowing of the last job processed on a now empty queue?


More information about the rabbitmq-discuss mailing list