[rabbitmq-discuss] BasicCancel and the QueueingBasicConsumer SharedQueue

Matthias Radestock matthias at rabbitmq.com
Tue Nov 6 14:59:00 GMT 2012


Mark,

On 05/11/12 17:35, Mark Ward wrote:
> What becomes of messages in the QueueingBasicConsumer SharedQueue when
> BasicCancel has been called?  Say a client has had a rather large
> prefetch and during the BasicCancel there are a number of messages from
> the queue in the SharedQueue.  Will the messages in the SharedQueue be
> ignored by the BasicCancel and remain or will the BasicCancel clean up
> the SharedQueue and remove the messages tied to the queue specified in
> the BasicCancel?

afaict, a consumer cancellation will result in an invocation of 
SharedQueue.Close(), which, according to the docs 
(http://www.rabbitmq.com/releases/rabbitmq-dotnet-client/v2.8.7/rabbitmq-dotnet-client-2.8.7-client-htmldoc/html/type-RabbitMQ.Util.SharedQueue.html#method-M:RabbitMQ.Util.SharedQueue.Close) 
and my reading of the code will cause Dequeue() to throw an 
EndOfStreamException *once the queue is empty*.

In other words, any messages received prior to the cancel/cancel-ok will 
remain the SharedQueue and can be retrieved from it as normal.


Regards,

Matthias.


More information about the rabbitmq-discuss mailing list