[rabbitmq-discuss] Parallel processing with QueueingBasicConsumer
Emile Joubert
emile at rabbitmq.com
Wed Nov 14 15:41:00 GMT 2012
Hi Mark,
On 13/11/12 22:32, Mark Ward wrote:
> What I would like to double check is if when using a QueueingBasicConsumer
> if it is possible to spawn a Task/Thread for each dequeued item. Then in
> each Task/Thread it will perform the ack.
>
> Is it ok to call the BasicAck in a Task/Thread below? The code is only to
> illustrate the idea.
It is possible for multiple threads to share an IModel, even though the
recommendation is to use an IModel per thread. The threads will need to
enforce mutual exclusion. You risk malformed frames if multiple threads
are permitted to share an IModel without synchronisation.
Also see section 2.10 in the .Net library user guide:
http://www.rabbitmq.com/releases/rabbitmq-dotnet-client/v2.8.7/rabbitmq-dotnet-client-2.8.7-user-guide.pdf
-Emile
More information about the rabbitmq-discuss
mailing list