[rabbitmq-discuss] Strategy for consuming queues and ordering

Robert Raschke rtrlists at googlemail.com
Thu Feb 10 09:55:31 GMT 2011

Hi Alfonso,

On Thu, Feb 10, 2011 at 9:44 AM, Alfonso Pantoja
<alfonso.pantoja at gmail.com>wrote:

> Can anyone tell me how to deal with queues that contain messages that
> are higly recommended by business logic to be ordered?
> As far as I know when messages are not acked and a BasicRecover(true)
> is done or the consumer is reconnected all these messages are requeued
> so the order is lost.
> The more suitable strategy I've found in queues where ordering is
> important is to use one consumer that stops the consuming process
> conditioned to the treatment of the message. In other words, it does
> not consume any more message until the current message is, for
> example, successfully stored in the database.
> The drawback of this is that in case of a consumer is disconnected the
> current message is not acked so it will be requeued so the order will
> be lost.
> Advice on this would be really appreciated :)
Whenever I hear about the problem of the required order of messages having
to be preserved, I start to wonder if the problem at hand is really best
suited to messaging. Could it be that you might be better served by
something like a (normal) work queue?

If you require things to be done in a certain order, then you need to have a
place to actually keep them in that order. Messaging isn't the place to do

Your scenario sounds like you would like to store your "stuff" in order
someplace, have a worker mark it as being worked upon, and remove it only
once the worker is finished.

Sorry for not giving much rabbity help,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110210/9668ac06/attachment.htm>

More information about the rabbitmq-discuss mailing list