[rabbitmq-discuss] .NET DefaultBasicConsumer / BasicQueuingConsumer and 'noack' scenarios

SimonT simonthorogood at hotmail.com
Fri May 25 08:19:32 BST 2012

In a consumer scenario where messages are ack'd, we are using a 
BasicQueuingConsumer and a Qos(0, x, false) operation to ensure that only a 
specific no. (x) of unack'd messages are dequeued at any time. This seems 
to work well.

If however, I try setting noack = true and switch off the Qos call (lets 
say we favour throughput over guaranteed delivery), I get an exception from 

RabbitMQ.Client.Exceptions.OperationInterruptedException: The AMQP 
operation was
 interrupted: AMQP close-reason, initiated by Peer, code=406, 
_FAILED - unknown delivery tag 1", classId=60, methodId=80, cause=
   at RabbitMQ.Client.Impl.SimpleBlockingRpcContinuation.GetReply()
   at RabbitMQ.Client.Impl.ModelBase.BasicConsume(String queue, Boolean 
noAck, S
tring consumerTag, Boolean noLocal, Boolean exclusive, IDictionary 
arguments, IB
asicConsumer consumer)

Am I right in thinking then that BasicQueuingConsumer only plays well with 
noack=false scenarios - e.g.

var queueingConsumer = new QueueingBasicConsumer(_channel);
_channel.BasicConsume(queueName, false, queueingConsumer);

if so, then for noack=true, is the correct/recommended approach to use a 
DefaultBasicConsumer instead. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20120525/6858c1b7/attachment.htm>

More information about the rabbitmq-discuss mailing list