[rabbitmq-discuss] Ordering of redelivered messages?

Marek Majkowski majek04 at gmail.com
Fri Jan 28 15:01:36 GMT 2011


On Fri, Jan 28, 2011 at 14:29, Grzegorz Nosek <root at localdomain.pl> wrote:
> W dniu 28.01.2011 15:00, Marek Majkowski pisze:
>>
>> Yes. The messages which are delivered-but-not-yet-acked will be
>> redelivered
>> when the consumer disconnects. That breaks the ordering.
>
> So "delivered" means to a queue, not to a consumer,

Both, depending on context :)

> right (there was no consumer present at that time to be delivered to)?

When you "publish" a message, it's going to be delivered to the queue.

A queue is a FIFO structure.

When you do "basic_consume" or "basic_get", from your
program (let's call this program a "consumer"), a message
gets send over the wire from the server to the consumer,
and it's delivered to your "consumer".

At that point two things can happen:
 a) your consumer send "basic_ack" back to the server,
     and server gets rid of the message.
 b) your consumer may die. In which case the server
    will notice it, and "redeliver" the unacknowledged message(s)
    back to the queue.




>>> If prefetch_count=1 had been set, there would be at most one message in
>>> this
>>> state, so the reordering would happen only to it (so, no effect).
>>
>> Correct.
>
> Thanks a lot.
>
> Best regards,
>  Grzegorz Nosek
>


More information about the rabbitmq-discuss mailing list