Table of Contents

Class EventingBasicConsumer

Namespace
RabbitMQ.Client.Events
Assembly
RabbitMQ.Client.dll

Experimental class exposing an IBasicConsumer's methods as separate events.

public class EventingBasicConsumer : DefaultBasicConsumer, IBasicConsumer
Inheritance
EventingBasicConsumer
Implements
Inherited Members

Constructors

EventingBasicConsumer(IModel)

Constructor which sets the Model property to the given value.

public EventingBasicConsumer(IModel model)

Parameters

model IModel

Methods

HandleBasicCancelOk(string)

Fires when the server confirms successful consumer cancelation.

public override void HandleBasicCancelOk(string consumerTag)

Parameters

consumerTag string

HandleBasicConsumeOk(string)

Fires when the server confirms successful consumer cancelation.

public override void HandleBasicConsumeOk(string consumerTag)

Parameters

consumerTag string

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

Invoked when a delivery arrives for the consumer.

public override void 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>

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.

HandleModelShutdown(object, ShutdownEventArgs)

Fires the Shutdown event.

public override void HandleModelShutdown(object model, ShutdownEventArgs reason)

Parameters

model object
reason ShutdownEventArgs

Events

Received

Event fired when a delivery arrives for the consumer.

public event EventHandler<BasicDeliverEventArgs> Received

Event Type

EventHandler<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 EventHandler<ConsumerEventArgs> Registered

Event Type

EventHandler<ConsumerEventArgs>

Shutdown

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

public event EventHandler<ShutdownEventArgs> Shutdown

Event Type

EventHandler<ShutdownEventArgs>

Unregistered

Fires when the server confirms successful consumer cancelation.

public event EventHandler<ConsumerEventArgs> Unregistered

Event Type

EventHandler<ConsumerEventArgs>