[rabbitmq-discuss] Acknowledging messages using the EventingBasicConsumer

Toby Riley toby.riley at rekoop.com
Sat Aug 4 14:51:50 BST 2012

Thanks Emile,

I'll probably go with the auto ack for now or _channel.BasicAck as it's quite legal to access the property within the anonymous delegate. However it would make sense to use the BasicAck on the sender as it seems cleaner and more obvious.



-----Original Message-----
From: Emile Joubert [mailto:emile at rabbitmq.com] 
Sent: 02 August 2012 15:20
To: Discussions about RabbitMQ
Cc: Toby Riley
Subject: Re: [rabbitmq-discuss] Acknowledging messages using the EventingBasicConsumer

Hi Toby,

On 02/08/12 12:05, Toby Riley wrote:
> I have a question I could not find a proper answer to anywhere, and it 
> is to do with the Acknowledging messages using the
> EventingBasicConsumer, I’m using   _channel.BasicAck(e.DeliveryTag,
> false); but there is one for o.Model. BasicAck(e.DeliveryTag, false) 
> but the sender object (o) is null.
> What is the proper way to Acknowledge message from the Received event 
> when using the EventingBasicConsumer when you inside the delegate?

You should first make sure that it is correct to acknowledge the message. If there were any asynchronous events that could fail and that were triggered as a result of the message then you might as well use automatic acknowledgements.

I'm not sure why the event sender is null in your example. That may well be a bug in EventingBasicConsumer, which is classed as experimental.
Using the sender would be the preferable approach. I will file a bug to investigate why the value is null. Thanks for reporting this.


More information about the rabbitmq-discuss mailing list