[rabbitmq-discuss] QueueingBasicConsumer

David R. MacIver david.maciver at lshift.net
Thu Feb 11 16:30:53 GMT 2010

On Tue, Feb 09, 2010 at 10:26:33AM +0000, Reddy, Rajesh (GPT EMEA) wrote:
> Hi
> According to the rabbit .Net client documentation,QueueingBasicConsumer
> is the safest way of subscribing to a queue, because its
> implementation uses RabbitMQ.Util.SharedQueue to pass deliveries over to
> the application thread,where all processing of received deliveries is
> done, and where any AMQP IModel operation is safe.
> But, when I checked the sourcecode it is just accumulating the messages
> on a shared queue and doesn't route the messages to application thread.
> So when iam using the QueueingBasicConsumer, the messages arrive on the
> rabbit thread and processed on the same thread.
> Is this some thing already known or left to the users to implement.

Hi Rajesh,

Rather by its nature, message processing is something left to the users to
implement. Rabbit is just there to make sure the messages get delivered. 
What you do with them when they arrive is up to you. 

With normal BasicConsumers you write the code that processes the message in the
consumer implementation and it gets run in the rabbit thread. With 
QueueingBasicConsumer the only "processing" it does is to enqueue the messages 
in a SharedQueue, so you instead write the message processing code in whatever
is using the consumer by pulling things off that queue, and it runs in whatever 
thread you tell it to.


More information about the rabbitmq-discuss mailing list