[rabbitmq-discuss] Consumer cancel notification received on a new consumer on an HA-queue after node fail-over

Simon MacMullen simon at rabbitmq.com
Thu Dec 12 10:25:01 GMT 2013


On 11/12/2013 14:51, Mike Hadlow wrote:
> I have a question concerning consumer cancel notification when a
> consumer is conusming from a queue when the cluster node that it is
> connected to fails. In the docs
> (http://www.rabbitmq.com/consumer-cancel.html) it states:
>
> "Other events, such as the queue being deleted, or in a clustered
> scenario, the node on which the queue is located failing, will cause the
> consumption to be cancelled, but the client channel will not be
> informed, which is frequently unhelpful."
>
> Surely if the node fails, the connection and channel will be
> disconnected, so the consumer would not be able to receive a consumer
> cancel notification?

I think that text is trying to say that if the node fails while the 
consumer is connected to a different node then the consumer will be 
cancelled.

> I am seeing behavior where a node fails, I immediately connect to an
> alternative node, start a new consumer on the HA-queue, which then
> immediately receives a consumer cancel notification. This only seems to
> happen intermittently, which is doubly confusing.

Yes, it's likely to be possible that if you reconnect fast enough the 
queue metadata has not yet been updated, so you consume from the old 
master and immediately get a cancel notification. But you'd just want to 
handle that the same way as any other cancellation - presumably by 
reissuing basic.consume. You need to handle that anyway, so this is a 
bit counterintuitive but I wouldn't call it a bug.

Cheers, Simon



More information about the rabbitmq-discuss mailing list