|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Consumer
Interface for application callback objects to receive notifications and messages from
a queue by subscription.
Most implementations will subclass DefaultConsumer.
Connection's thread. This
allows Consumers to call Channel or Connection methods without causing a deadlock.
The Consumers on a particular Channel are invoked serially on one or more
dispatch threads. Consumers should avoid executing long-running code
because this will delay dispatch of messages to other Consumers on the same
Channel.
Channel.basicConsume(String, boolean, String, boolean, boolean, java.util.Map, Consumer),
Channel.basicCancel(java.lang.String)| Method Summary | |
|---|---|
void |
handleCancel(java.lang.String consumerTag)
Called when the consumer is cancelled for reasons other than by a call to Channel.basicCancel(java.lang.String). |
void |
handleCancelOk(java.lang.String consumerTag)
Called when the consumer is cancelled by a call to Channel.basicCancel(java.lang.String). |
void |
handleConsumeOk(java.lang.String consumerTag)
Called when the consumer is registered by a call to any of the Channel.basicConsume(java.lang.String, com.rabbitmq.client.Consumer) methods. |
void |
handleDelivery(java.lang.String consumerTag,
Envelope envelope,
AMQP.BasicProperties properties,
byte[] body)
Called when a basic.deliver is received for this consumer. |
void |
handleRecoverOk(java.lang.String consumerTag)
Called when a basic.recover-ok is received
in reply to a basic.recover. |
void |
handleShutdownSignal(java.lang.String consumerTag,
ShutdownSignalException sig)
Called when either the channel or the underlying connection has been shut down. |
| Method Detail |
|---|
void handleConsumeOk(java.lang.String consumerTag)
Channel.basicConsume(java.lang.String, com.rabbitmq.client.Consumer) methods.
consumerTag - the consumer tag associated with the consumervoid handleCancelOk(java.lang.String consumerTag)
Channel.basicCancel(java.lang.String).
consumerTag - the consumer tag associated with the consumer
void handleCancel(java.lang.String consumerTag)
throws java.io.IOException
Channel.basicCancel(java.lang.String). For example, the queue has been deleted.
See handleCancelOk(java.lang.String) for notification of consumer
cancellation due to Channel.basicCancel(java.lang.String).
consumerTag - the consumer tag associated with the consumer
java.io.IOException
void handleShutdownSignal(java.lang.String consumerTag,
ShutdownSignalException sig)
consumerTag - the consumer tag associated with the consumersig - a ShutdownSignalException indicating the reason for the shut downvoid handleRecoverOk(java.lang.String consumerTag)
basic.recover-ok is received
in reply to a basic.recover. All messages
received before this is invoked that haven't been ack'ed will be
re-delivered. All messages received afterwards won't be.
consumerTag - the consumer tag associated with the consumer
void handleDelivery(java.lang.String consumerTag,
Envelope envelope,
AMQP.BasicProperties properties,
byte[] body)
throws java.io.IOException
basic.deliver is received for this consumer.
consumerTag - the consumer tag associated with the consumerenvelope - packaging data for the messageproperties - content header data for the messagebody - the message body (opaque, client-specific byte array)
java.io.IOException - if the consumer encounters an I/O error while processing the messageEnvelope
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||