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()
No-op implementation of
Consumer.handleRecoverOk() . |
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 Consumer
consumerTag
- the defined consumerTag (either client- or server-generated)Consumer.handleConsumeOk(java.lang.String)
public void handleCancelOk(java.lang.String consumerTag)
Consumer.handleCancelOk(java.lang.String)
.handleCancelOk
in interface Consumer
consumerTag
- 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 Consumer
consumerTag
- the defined consumer tag (client- or server-generated)java.io.IOException
public void handleShutdownSignal(java.lang.String consumerTag, ShutdownSignalException sig)
Consumer.handleShutdownSignal(java.lang.String, com.rabbitmq.client.ShutdownSignalException)
.handleShutdownSignal
in interface Consumer
consumerTag
- the defined consumerTag (either client- or server-generated)sig
- an exception object encapsulating the reason for shutdownpublic void handleRecoverOk()
Consumer.handleRecoverOk()
.handleRecoverOk
in interface Consumer
public 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 Consumer
consumerTag
- the defined consumerTag (either client- or server-generated)envelope
- 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 hits an I/O error while processing the messagepublic Channel getChannel()
public java.lang.String getConsumerTag()