[rabbitmq-discuss] Receiving Undelivered Persistent Messages

Matthias Radestock matthias at lshift.net
Mon Aug 10 09:16:17 BST 2009


Vidit Drolia wrote:

> When a consumer's channel is closed, then all unacknowledged messages
> are still available in the queue for subsequent consumers. If there
> are N messages in the queue when the last consumer died, then when a
> new consumer fires up, 1 message is delivered when the consumer
> requests for a message by subscription. That is to say, executing:
> while(true){
>   delivery = consumer.nextDelivery();
> //do something...
> //acknowledge for delivery
> }
> will deliver 1 message leaving N-1 messages in the queue. However,
> after one execution of the above loop, the consumer keeps waiting for
> the next delivery, even though there are N-1 messages in the queue. My
> question was, is this supposed to happen by design of a subscription.

No, that is not supposed to happen. If there are N messages in the queue 
and you have one consumer connecting to it and consuming messages as you 
describe then that consumer should receive all the messages.

What client are you using? Can you post all the code to reproduce this?



More information about the rabbitmq-discuss mailing list