Table of Contents

Class AsyncEventingBasicConsumer

Namespace
RabbitMQ.Client.Events
Assembly
RabbitMQ.Client.dll
public class AsyncEventingBasicConsumer : AsyncDefaultBasicConsumer, IBasicConsumer, IAsyncBasicConsumer
Inheritance
AsyncEventingBasicConsumer
Implements
Inherited Members

Constructors

AsyncEventingBasicConsumer(IModel)

Constructor which sets the Model property to the given value.

public AsyncEventingBasicConsumer(IModel model)

Parameters

model IModel

Methods

HandleBasicCancelOk(string)

Fires when the server confirms successful consumer cancelation.

public override Task HandleBasicCancelOk(string consumerTag)

Parameters

consumerTag string

Returns

Task

HandleBasicConsumeOk(string)

Fires when the server confirms successful consumer registration.

public override Task HandleBasicConsumeOk(string consumerTag)

Parameters

consumerTag string

Returns

Task

HandleBasicDeliver(string, ulong, bool, string, string, IBasicProperties, ReadOnlyMemory<byte>)

Fires the Received event.

public override Task HandleBasicDeliver(string consumerTag, ulong deliveryTag, bool redelivered, string exchange, string routingKey, IBasicProperties properties, ReadOnlyMemory<byte> body)

Parameters

consumerTag string
deliveryTag ulong
redelivered bool
exchange string
routingKey string
properties IBasicProperties
body ReadOnlyMemory<byte>

Returns

Task

HandleModelShutdown(object, ShutdownEventArgs)

Fires the Shutdown event.

public override Task HandleModelShutdown(object model, ShutdownEventArgs reason)

Parameters

model object
reason ShutdownEventArgs

Returns

Task

Events

Received

Event fired when a delivery arrives for the consumer.

public event AsyncEventHandler<BasicDeliverEventArgs> Received

Event Type

AsyncEventHandler<BasicDeliverEventArgs>

Remarks

Handlers must copy or fully use delivery body before returning. Accessing the body at a later point is unsafe as its memory can be already released.

Registered

Fires when the server confirms successful consumer cancelation.

public event AsyncEventHandler<ConsumerEventArgs> Registered

Event Type

AsyncEventHandler<ConsumerEventArgs>

Shutdown

Fires on model (channel) shutdown, both client and server initiated.

public event AsyncEventHandler<ShutdownEventArgs> Shutdown

Event Type

AsyncEventHandler<ShutdownEventArgs>

Unregistered

Fires when the server confirms successful consumer cancelation.

public event AsyncEventHandler<ConsumerEventArgs> Unregistered

Event Type

AsyncEventHandler<ConsumerEventArgs>