public interface IBasicConsumer

Summary

Consumer interface for Basic content-class. Used to receive messages from a queue by subscription.

Remarks

See IModel.BasicConsume, IModel.BasicCancel.

Note that the "Handle*" methods run in the connection's thread! Consider using QueueingBasicConsumer, which uses a SharedQueue instance to safely pass received messages across to user threads.

Property Summary

Type Name Summary
IModel Model (r)

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

Method Summary

Name Summary
void HandleBasicCancelOk(string consumerTag)

Called upon successful deregistration of the consumer from the broker.

void HandleBasicConsumeOk(string consumerTag)

Called upon successful registration of the consumer with the broker.

void HandleBasicDeliver(string consumerTag, ulong deliveryTag, bool redelivered, string exchange, string routingKey, IBasicProperties properties, byte[] body)

Called each time a message arrives for this consumer.

void HandleModelShutdown(IModel model, ShutdownEventArgs reason)

Called when the model shuts down.

Property Detail

IModel Model (r)

Summary

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

Method Detail

HandleBasicCancelOk

void HandleBasicCancelOk(string consumerTag)

Return type void
Parameters
Name Type
consumerTag string

Summary

Called upon successful deregistration of the consumer from the broker.

HandleBasicConsumeOk

void HandleBasicConsumeOk(string consumerTag)

Return type void
Parameters
Name Type
consumerTag string

Summary

Called upon successful registration of the consumer with the broker.

HandleBasicDeliver

void HandleBasicDeliver(string consumerTag, ulong deliveryTag, bool redelivered, string exchange, string routingKey, IBasicProperties properties, byte[] body)

Return type void
Parameters
Name Type
consumerTag string
deliveryTag ulong
redelivered bool
exchange string
routingKey string
properties IBasicProperties
body byte[]

Summary

Called each time a message arrives for this consumer.

Remarks

Be aware that acknowledgement may be required. See IModel.BasicAck.

HandleModelShutdown

void HandleModelShutdown(IModel model, ShutdownEventArgs reason)

Return type void
Parameters
Name Type
model IModel
reason ShutdownEventArgs

Summary

Called when the model shuts down.