[rabbitmq-discuss] Async consumer for .net client

Vadim Chekan kot.begemot at gmail.com
Fri Jan 7 20:01:10 GMT 2011


I hate those mailist where you have to "reply to all", so repeating my
previous mail:

I see. So it is not there out of the box, but you can do it.
Perhaps QueingBasicConsumer is the right place to add async event
because it disconnects message receiving from handling by using
internal in-memory queue.

Vadim.

On Fri, Jan 7, 2011 at 1:51 AM, Matthias Radestock
<matthias at rabbitmq.com> wrote:
> Vadim,
>
> Vadim Chekan wrote:
>>
>> Is it possible to consume messages asynchronously in .net client?
>> What I want is something like this (pseudocode)
>>
>> var consumer = new SomeConsumer(_model, queue);
>> consumer.OnRecieve = (msg) => {
>>  ClearCache(); // do my stuff
>>  _model.Ack(msg);
>> }
>
> See section 2.8 of the RabbitMQ .Net Client  Library User Guide:
> <quote>
> Another alternative is to subclass DefaultBasicConsumer, overriding methods
> as necessary, or implement IBasicConsumer directly. You will generally want
> to implement the core method HandleBasicDeliver.
> </quote>
>
> Make sure to also read the section after that on "Threading, deadlocks, and
> associated restrictions on consumers".
>
>
> Regards,
>
> Matthias.
>



-- 
>From RFC 2631: In ASN.1, EXPLICIT tagging is implicit unless IMPLICIT
is explicitly specified


More information about the rabbitmq-discuss mailing list