[rabbitmq-discuss] Ordering of redelivered messages?

Marek Majkowski majek04 at gmail.com
Fri Jan 28 16:32:40 GMT 2011


On Fri, Jan 28, 2011 at 15:44, Grzegorz Nosek <root at localdomain.pl> wrote:
> W dniu 28.01.2011 16:32, Marek Majkowski pisze:
>>
>> Rather a). I guess you forgot to call "basic_ack" after a message.
>
> I do call chan.basic_ack() after processing the message, otherwise the
> messages would accumulate in the broker forever (or the messages would be
> auto acked so shouldn't ever trigger redelivery). Or am I severely mistaken
> here?
>
>> Check out the "forgotten acknowledgement" box here:
>>    http://www.rabbitmq.com/tutorial-two-python.html
>
> Nope, no unacknowledged messages here.

Okay.

>> When first consumer "subscribes" to a queue (using basic_consume),
>> messages will be just delivered to it. Without 'basic_qos(prefetch_count)'
>> *all* the messages will be immediately delivered to that consumer.
>> (note: that's not exactly true).
>>
>> Nothing else happens on subscription.
>>
>> The "redelivery of unacked messages back to the queue" happens when
>> consumer gets *disconnected*.
>
> OK but that still does not explain what I have observed. The messages in the
> queue have never been delivered (successfully or otherwise) to anybody
> before,

In such case they will be delivered to the consumer in the same order they
were delivered to the queue.

> because they were published after the original consumer was gone
> (and before the new one that eventually got them connected).


More information about the rabbitmq-discuss mailing list