C# 클래스 RabbitMQ.Client.DefaultBasicConsumer

Useful default/base implementation of IBasicConsumer. Subclass and override HandleBasicDeliver in application code.
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, or RabbitMQ.Client.MessagePatterns.Subscription, which manages resource declaration and binding in addition to providing a thread-safe interface.
상속: IBasicConsumer
파일 보기 프로젝트 열기: rabbitmq/rabbitmq-dotnet-client 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
m_consumerCancelled EventHandler
m_eventLock object

공개 메소드들

메소드 설명
DefaultBasicConsumer ( ) : System

Creates a new instance of an DefaultBasicConsumer.

DefaultBasicConsumer ( IModel model ) : System

Constructor which sets the Model property to the given value.

HandleBasicCancel ( string consumerTag ) : void

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 for notification of consumer cancellation due to basicCancel

HandleBasicCancelOk ( string consumerTag ) : void

Called upon successful deregistration of the consumer from the broker.

HandleBasicConsumeOk ( string consumerTag ) : void

Called upon successful registration of the consumer with the broker.

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

Called each time a message arrives for this consumer.

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

HandleModelShutdown ( object model, RabbitMQ.Client.ShutdownEventArgs reason ) : void

Called when the model shuts down.

OnCancel ( ) : void

Default implementation - overridable in subclasses.

This default implementation simply sets the IsRunning property to false, and takes no further action.

메소드 상세

DefaultBasicConsumer() 공개 메소드

Creates a new instance of an DefaultBasicConsumer.
public DefaultBasicConsumer ( ) : System
리턴 System

DefaultBasicConsumer() 공개 메소드

Constructor which sets the Model property to the given value.
public DefaultBasicConsumer ( IModel model ) : System
model IModel Common AMQP model.
리턴 System

HandleBasicCancel() 공개 메소드

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 for notification of consumer cancellation due to basicCancel
public HandleBasicCancel ( string consumerTag ) : void
consumerTag string Consumer tag this consumer is registered.
리턴 void

HandleBasicCancelOk() 공개 메소드

Called upon successful deregistration of the consumer from the broker.
public HandleBasicCancelOk ( string consumerTag ) : void
consumerTag string Consumer tag this consumer is registered.
리턴 void

HandleBasicConsumeOk() 공개 메소드

Called upon successful registration of the consumer with the broker.
public HandleBasicConsumeOk ( string consumerTag ) : void
consumerTag string Consumer tag this consumer is registered.
리턴 void

HandleBasicDeliver() 공개 메소드

Called each time a message arrives for this consumer.
Does nothing with the passed in information. Note that in particular, some delivered messages may require acknowledgement via IModel.BasicAck. The implementation of this method in this class does NOT acknowledge such messages.
public HandleBasicDeliver ( string consumerTag, ulong deliveryTag, bool redelivered, string exchange, string routingKey, IBasicProperties properties, byte body ) : void
consumerTag string
deliveryTag ulong
redelivered bool
exchange string
routingKey string
properties IBasicProperties
body byte
리턴 void

HandleModelShutdown() 공개 메소드

Called when the model shuts down.
public HandleModelShutdown ( object model, RabbitMQ.Client.ShutdownEventArgs reason ) : void
model object Common AMQP model.
reason RabbitMQ.Client.ShutdownEventArgs Information about the reason why a particular model, session, or connection was destroyed.
리턴 void

OnCancel() 공개 메소드

Default implementation - overridable in subclasses.
This default implementation simply sets the IsRunning property to false, and takes no further action.
public OnCancel ( ) : void
리턴 void

프로퍼티 상세

m_consumerCancelled 공개적으로 프로퍼티

public EventHandler m_consumerCancelled
리턴 EventHandler

m_eventLock 공개적으로 프로퍼티

public object m_eventLock
리턴 object