[rabbitmq-discuss] IModel thread safety in.NET client

TrueWill baldgoth at gmail.com
Wed Oct 12 20:29:42 BST 2011

The .NET client user guide (v2.6.1) states that IModel should not be
shared between threads.

Apparently BasicAck must be called on the same channel on which the
message was received.

When asynchronously consuming messages with IBasicConsumer, is it safe
to call BasicAck on the original channel (created on the application
thread) in the handler without locking?

I'm assuming that the handler runs on the connection thread.

I realize that publish should not be called in the handler. If publish
can be called by the application thread, should that be done on a
separate channel from the consuming one?

(There's a similar question on the Java client here:

More information about the rabbitmq-discuss mailing list