public class

DefaultConsumer

extends Object
implements Consumer
java.lang.Object
   ↳ com.rabbitmq.client.DefaultConsumer
Known Direct Subclasses

Class Overview

Convenience class providing a default implementation of Consumer. We anticipate that most Consumer implementations will subclass this class.

Summary

Public Constructors
DefaultConsumer(Channel channel)
Constructs a new instance and records its association to the passed-in channel.
Public Methods
Channel getChannel()
Retrieve the channel.
String getConsumerTag()
Retrieve the consumer tag.
void handleCancel(String consumerTag)
No-op implementation of handleCancel(String)
void handleCancelOk(String consumerTag)
No-op implementation of handleCancelOk(String).
void handleConsumeOk(String consumerTag)
Stores the most recently passed-in consumerTag - semantically, there should be only one.
void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body)
void handleRecoverOk(String consumerTag)
No-op implementation of handleRecoverOk(String).
void handleShutdownSignal(String consumerTag, ShutdownSignalException sig)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.rabbitmq.client.Consumer

Public Constructors

public DefaultConsumer (Channel channel)

Constructs a new instance and records its association to the passed-in channel.

Parameters
channel the channel to which this consumer is attached

Public Methods

public Channel getChannel ()

Retrieve the channel.

Returns
  • the channel this consumer is attached to.

public String getConsumerTag ()

Retrieve the consumer tag.

Returns
  • the most recently notified consumer tag.

public void handleCancel (String consumerTag)

No-op implementation of handleCancel(String)

Parameters
consumerTag the defined consumer tag (client- or server-generated)
Throws
IOException

public void handleCancelOk (String consumerTag)

No-op implementation of handleCancelOk(String).

Parameters
consumerTag the defined consumer tag (client- or server-generated)

public void handleConsumeOk (String consumerTag)

Stores the most recently passed-in consumerTag - semantically, there should be only one.

Parameters
consumerTag the consumer tag associated with the consumer

public void handleDelivery (String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body)

Parameters
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)
Throws
IOException

public void handleRecoverOk (String consumerTag)

No-op implementation of handleRecoverOk(String).

Parameters
consumerTag the consumer tag associated with the consumer

public void handleShutdownSignal (String consumerTag, ShutdownSignalException sig)

Parameters
consumerTag the consumer tag associated with the consumer
sig a ShutdownSignalException indicating the reason for the shut down