[rabbitmq-discuss] Redelivery of unacknowledged messages

Gordon Sim gsim at redhat.com
Thu Oct 2 08:41:19 BST 2008


Jonatan Kallus wrote:
> Is it meant to work like this or is it a matter of a feature not being 
> implemented yet?
> 
> In my current implementation I am closing the channel occasionally, for 
> no particular reason, but to get the redeliveries. 

You could use basic.recover(): "This method asks the broker to redeliver 
all unacknowledged messages on a specified channel".

There is a 'requeue' argument to that method: "If this field is zero, 
the message will be redelivered to the original recipient. If this bit 
is 1, the server will attempt to requeue the message, potentially then 
delivering it to an alternative subscriber."

> This causes the 
> processing to temporarily stop or slow down since I have to wait for all 
> tasks to be done and acked before I can close the channel. (Since 
> messages need to be acked on the same channel they were received on, as 
> far as I know.)

I'm a bit confused by this... if you ack all the messages on the 
channel, closing it will not result in any redeliveries?

> It would probably be possible to have two parallel channels open, one 
> active (receiving new tasks) and one waiting for its tasks to be done 
> and acked, then closing the inactive one, making the previously active 
> one passive and opening a new active channel. This would add the 
> complexity of keeping track of what message that should be acked on what 
> channel.
> 
> Are there any good patterns to handle this?

What is the motivation for wanting messages to be redelivered?




More information about the rabbitmq-discuss mailing list