com.rabbitmq.client.Consumer |
Known Indirect Subclasses |
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 Consumer
s to call Channel
or Connection
methods without causing a deadlock.
The Consumer
s on a particular Channel
are invoked serially on one or more
dispatch threads. Consumer
s should avoid executing long-running code
because this will delay dispatch of messages to other Consumer
s on the same
Channel
.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Called when the consumer is cancelled for reasons other than by a call to
basicCancel(String) . | |||||||||||
Called when the consumer is cancelled by a call to
basicCancel(String) . | |||||||||||
Called when the consumer is registered by a call to any of the
basicConsume(String, boolean, Consumer) methods. | |||||||||||
Called when a
basic.deliver is received for this consumer. | |||||||||||
Called when a
basic.recover-ok is received
in reply to a basic.recover . | |||||||||||
Called when either the channel or the underlying connection has been shut down.
|
Called when the consumer is cancelled for reasons other than by a call to
basicCancel(String)
. For example, the queue has been deleted.
See handleCancelOk(String)
for notification of consumer
cancellation due to basicCancel(String)
.
consumerTag | the consumer tag associated with the consumer |
---|
IOException |
---|
Called when the consumer is cancelled by a call to basicCancel(String)
.
consumerTag | the consumer tag associated with the consumer |
---|
Called when the consumer is registered by a call to any of the
basicConsume(String, boolean, Consumer)
methods.
consumerTag | the consumer tag associated with the consumer |
---|
Called when a basic.deliver
is received for this consumer.
consumerTag | the consumer tag associated with the consumer |
---|---|
envelope | packaging data for the message |
properties | content header data for the message |
body | the message body (opaque, client-specific byte array) |
IOException | if the consumer encounters an I/O error while processing the message |
---|
Called when a 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 |
---|
Called when either the channel or the underlying connection has been shut down.
consumerTag | the consumer tag associated with the consumer |
---|---|
sig | a ShutdownSignalException indicating the reason for the shut down
|