Class AsyncEventingBasicConsumer
public class AsyncEventingBasicConsumer : AsyncDefaultBasicConsumer, IAsyncBasicConsumer
- Inheritance
-
AsyncEventingBasicConsumer
- Implements
- Inherited Members
Constructors
AsyncEventingBasicConsumer(IChannel)
Constructor which sets the Channel property to the given value.
public AsyncEventingBasicConsumer(IChannel channel)
Parameters
channel
IChannel
Methods
HandleBasicConsumeOkAsync(string, CancellationToken)
Fires when the server confirms successful consumer registration.
public override Task HandleBasicConsumeOkAsync(string consumerTag, CancellationToken cancellationToken = default)
Parameters
consumerTag
stringcancellationToken
CancellationToken
Returns
HandleBasicDeliverAsync(string, ulong, bool, string, string, IReadOnlyBasicProperties, ReadOnlyMemory<byte>, CancellationToken)
Fires the Received event.
public override Task HandleBasicDeliverAsync(string consumerTag, ulong deliveryTag, bool redelivered, string exchange, string routingKey, IReadOnlyBasicProperties properties, ReadOnlyMemory<byte> body, CancellationToken cancellationToken = default)
Parameters
consumerTag
stringdeliveryTag
ulongredelivered
boolexchange
stringroutingKey
stringproperties
IReadOnlyBasicPropertiesbody
ReadOnlyMemory<byte>cancellationToken
CancellationToken
Returns
HandleChannelShutdownAsync(object, ShutdownEventArgs)
Fires the Shutdown event.
public override Task HandleChannelShutdownAsync(object channel, ShutdownEventArgs reason)
Parameters
channel
objectreason
ShutdownEventArgs
Returns
OnCancelAsync(string[], CancellationToken)
Fires when the server confirms successful consumer cancellation.
protected override Task OnCancelAsync(string[] consumerTags, CancellationToken cancellationToken = default)
Parameters
consumerTags
string[]cancellationToken
CancellationToken
Returns
Events
ReceivedAsync
Event fired when a delivery arrives for the consumer.
public event AsyncEventHandler<BasicDeliverEventArgs> ReceivedAsync
Event Type
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.
RegisteredAsync
Fires when the server confirms successful consumer registration.
public event AsyncEventHandler<ConsumerEventArgs> RegisteredAsync
Event Type
ShutdownAsync
Fires on channel shutdown, both client and server initiated.
public event AsyncEventHandler<ShutdownEventArgs> ShutdownAsync
Event Type
UnregisteredAsync
Fires when the server confirms successful consumer cancellation.
public event AsyncEventHandler<ConsumerEventArgs> UnregisteredAsync