public class DefaultConsumer extends java.lang.Object implements Consumer
Consumer.
We anticipate that most Consumer implementations will subclass this class.| Constructor and Description |
|---|
DefaultConsumer(Channel channel)
Constructs a new instance and records its association to the passed-in channel.
|
| Modifier and Type | Method and Description |
|---|---|
Channel |
getChannel()
Retrieve the channel.
|
java.lang.String |
getConsumerTag()
Retrieve the consumer tag.
|
void |
handleCancel(java.lang.String consumerTag)
No-op implementation of
Consumer.handleCancel(String) |
void |
handleCancelOk(java.lang.String consumerTag)
No-op implementation of
Consumer.handleCancelOk(java.lang.String). |
void |
handleConsumeOk(java.lang.String consumerTag)
Stores the most recently passed-in consumerTag - semantically, there should be only one.
|
void |
handleDelivery(java.lang.String consumerTag,
Envelope envelope,
AMQP.BasicProperties properties,
byte[] body)
|
void |
handleRecoverOk(java.lang.String consumerTag)
No-op implementation of
Consumer.handleRecoverOk(java.lang.String). |
void |
handleShutdownSignal(java.lang.String consumerTag,
ShutdownSignalException sig)
No-op implementation of
Consumer.handleShutdownSignal(java.lang.String, com.rabbitmq.client.ShutdownSignalException). |
public DefaultConsumer(Channel channel)
channel - the channel to which this consumer is attachedpublic void handleConsumeOk(java.lang.String consumerTag)
handleConsumeOk in interface ConsumerconsumerTag - the consumer tag associated with the consumerConsumer.handleConsumeOk(java.lang.String)public void handleCancelOk(java.lang.String consumerTag)
Consumer.handleCancelOk(java.lang.String).handleCancelOk in interface ConsumerconsumerTag - the defined consumer tag (client- or server-generated)public void handleCancel(java.lang.String consumerTag)
throws java.io.IOException
Consumer.handleCancel(String)handleCancel in interface ConsumerconsumerTag - the defined consumer tag (client- or server-generated)java.io.IOExceptionpublic void handleShutdownSignal(java.lang.String consumerTag,
ShutdownSignalException sig)
Consumer.handleShutdownSignal(java.lang.String, com.rabbitmq.client.ShutdownSignalException).handleShutdownSignal in interface ConsumerconsumerTag - the consumer tag associated with the consumersig - a ShutdownSignalException indicating the reason for the shut downpublic void handleRecoverOk(java.lang.String consumerTag)
Consumer.handleRecoverOk(java.lang.String).handleRecoverOk in interface ConsumerconsumerTag - the consumer tag associated with the consumerpublic void handleDelivery(java.lang.String consumerTag,
Envelope envelope,
AMQP.BasicProperties properties,
byte[] body)
throws java.io.IOException
Consumer.handleDelivery(java.lang.String, com.rabbitmq.client.Envelope, com.rabbitmq.client.AMQP.BasicProperties, byte[]).handleDelivery in interface ConsumerconsumerTag - 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 messageEnvelopepublic Channel getChannel()
public java.lang.String getConsumerTag()