[rabbitmq-discuss] EventingBasicConsumer is still experimentals? (.NET client)

Matthias Radestock matthias at rabbitmq.com
Sun Nov 20 21:27:48 GMT 2011


Jason,

On 20/11/11 21:11, Jason J. W. Williams wrote:
> Where are those "consumption loops"? I do not see any in your
> examples.
>
> EventingBasicConsumer c_consumer = new EventingBasicConsumer {Model =
> chan};
 > c_consumer.Received += critical_notify;
> chan.BasicConsume("critical", false, c_consumer);

That's not much of a *loop* :)

> the user-guide for the .NET client recommends using
> QueuingBasicConsumer

...because that way the connection thread does not get blocked,
regardless of what the consumer code does.

> which when consuming from two queues would necessitate two
> consumer.Queue.Dequeue(); in a row. In that configuration, the first
> invocation waits/blocks to receive any message from it's queue before
> the second invocation gets hit.

One can pass the same consumer instance to multiple BasicConsume calls. 
Then the messages end up in just a single client-side queue.

> EventingBasicConsumer doesn't have that problem

Just implementing IBasicConsumer or sub-classing DefaultConsumer has the 
same effect. EventingBasicConsumer simply provides a different API.

Alas the risk of consumer code blocking the connection thread remains.


Regards,

Matthias.


More information about the rabbitmq-discuss mailing list