Table of Contents

Interface IAsyncBasicConsumer

Namespace
RabbitMQ.Client
Assembly
RabbitMQ.Client.dll
public interface IAsyncBasicConsumer

Properties

Model

Retrieve the IModel this consumer is associated with, for use in acknowledging received messages, for instance.

IModel Model { get; }

Property Value

IModel

Methods

HandleBasicCancel(string)

Called when the consumer is cancelled for reasons other than by a basicCancel: e.g. the queue has been deleted (either by this channel or by any other channel). See HandleBasicCancelOk(string) for notification of consumer cancellation due to basicCancel

Task HandleBasicCancel(string consumerTag)

Parameters

consumerTag string

Consumer tag this consumer is registered.

Returns

Task

HandleBasicCancelOk(string)

Called upon successful deregistration of the consumer from the broker.

Task HandleBasicCancelOk(string consumerTag)

Parameters

consumerTag string

Consumer tag this consumer is registered.

Returns

Task

HandleBasicConsumeOk(string)

Called upon successful registration of the consumer with the broker.

Task HandleBasicConsumeOk(string consumerTag)

Parameters

consumerTag string

Consumer tag this consumer is registered.

Returns

Task

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

Called each time a message arrives for this consumer.

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

Remarks

Does nothing with the passed in information. Note that in particular, some delivered messages may require acknowledgement via BasicAck(ulong, bool). The implementation of this method in this class does NOT acknowledge such messages.

HandleModelShutdown(object, ShutdownEventArgs)

Called when the model shuts down.

Task HandleModelShutdown(object model, ShutdownEventArgs reason)

Parameters

model object

Common AMQP model.

reason ShutdownEventArgs

Information about the reason why a particular model, session, or connection was destroyed.

Returns

Task

Events

ConsumerCancelled

Signalled when the consumer gets cancelled.

event AsyncEventHandler<ConsumerEventArgs> ConsumerCancelled

Event Type

AsyncEventHandler<ConsumerEventArgs>