org.springframework.amqp.rabbit.core
Class RabbitTemplate

java.lang.Object
  extended by org.springframework.amqp.rabbit.connection.RabbitAccessor
      extended by org.springframework.amqp.rabbit.core.RabbitTemplate
All Implemented Interfaces:
org.springframework.amqp.core.AmqpTemplate, org.springframework.amqp.core.MessageListener, RabbitOperations, PublisherCallbackChannel.Listener, org.springframework.beans.factory.InitializingBean

public class RabbitTemplate
extends RabbitAccessor
implements RabbitOperations, org.springframework.amqp.core.MessageListener, PublisherCallbackChannel.Listener

Helper class that simplifies synchronous RabbitMQ access (sending and receiving messages).

The default settings are for non-transactional messaging, which reduces the amount of data exchanged with the broker. To use a new transaction for every send or receive set the channelTransacted flag. To extend the transaction over multiple invocations (more efficient), you can use a Spring transaction to bracket the calls (with channelTransacted=true as well).

The only mandatory property is the ConnectionFactory. There are strategies available for converting messages to and from Java objects ( MessageConverter) and for converting message headers (known as message properties in AMQP, see MessagePropertiesConverter ). The defaults probably do something sensible for typical use cases, as long as the message content-type is set appropriately.

The "send" methods all have overloaded versions that allow you to explicitly target an exchange and a routing key, or you can set default values to be used in all send operations. The plain "receive" methods allow you to explicitly target a queue to receive from, or you can set a default value for the template that applies to all explicit receives. The convenience methods for send and receive use the sender defaults if no exchange or routing key is specified, but they always use a temporary queue for the receive leg, so the default queue is ignored.

Since:
1.0

Nested Class Summary
static interface RabbitTemplate.ConfirmCallback
           
static interface RabbitTemplate.ReturnCallback
           
 
Field Summary
 
Fields inherited from class org.springframework.amqp.rabbit.connection.RabbitAccessor
logger
 
Constructor Summary
RabbitTemplate()
          Convenient constructor for use with setter injection.
RabbitTemplate(ConnectionFactory connectionFactory)
          Create a rabbit template with default strategies and settings.
 
Method Summary
 void convertAndSend(java.lang.Object object)
           
 void convertAndSend(java.lang.Object message, org.springframework.amqp.core.MessagePostProcessor messagePostProcessor)
           
 void convertAndSend(java.lang.String routingKey, java.lang.Object object)
           
 void convertAndSend(java.lang.String routingKey, java.lang.Object object, CorrelationData correlationData)
           
 void convertAndSend(java.lang.String routingKey, java.lang.Object message, org.springframework.amqp.core.MessagePostProcessor messagePostProcessor)
           
 void convertAndSend(java.lang.String routingKey, java.lang.Object message, org.springframework.amqp.core.MessagePostProcessor messagePostProcessor, CorrelationData correlationData)
           
 void convertAndSend(java.lang.String exchange, java.lang.String routingKey, java.lang.Object object)
           
 void convertAndSend(java.lang.String exchange, java.lang.String routingKey, java.lang.Object object, CorrelationData corrationData)
           
 void convertAndSend(java.lang.String exchange, java.lang.String routingKey, java.lang.Object message, org.springframework.amqp.core.MessagePostProcessor messagePostProcessor)
           
 void convertAndSend(java.lang.String exchange, java.lang.String routingKey, java.lang.Object message, org.springframework.amqp.core.MessagePostProcessor messagePostProcessor, CorrelationData correlationData)
           
protected  org.springframework.amqp.core.Message convertMessageIfNecessary(java.lang.Object object)
           
 java.lang.Object convertSendAndReceive(java.lang.Object message)
           
 java.lang.Object convertSendAndReceive(java.lang.Object message, org.springframework.amqp.core.MessagePostProcessor messagePostProcessor)
           
 java.lang.Object convertSendAndReceive(java.lang.String routingKey, java.lang.Object message)
           
 java.lang.Object convertSendAndReceive(java.lang.String routingKey, java.lang.Object message, org.springframework.amqp.core.MessagePostProcessor messagePostProcessor)
           
 java.lang.Object convertSendAndReceive(java.lang.String exchange, java.lang.String routingKey, java.lang.Object message)
           
 java.lang.Object convertSendAndReceive(java.lang.String exchange, java.lang.String routingKey, java.lang.Object message, org.springframework.amqp.core.MessagePostProcessor messagePostProcessor)
           
 void correlationconvertAndSend(java.lang.Object object, CorrelationData correlationData)
           
protected  void doSend(com.rabbitmq.client.Channel channel, java.lang.String exchange, java.lang.String routingKey, org.springframework.amqp.core.Message message, CorrelationData correlationData)
          Send the given message to the specified exchange.
protected  org.springframework.amqp.core.Message doSendAndReceive(java.lang.String exchange, java.lang.String routingKey, org.springframework.amqp.core.Message message)
          Send a message and wait for a reply.
protected  org.springframework.amqp.core.Message doSendAndReceiveWithFixed(java.lang.String exchange, java.lang.String routingKey, org.springframework.amqp.core.Message message)
           
protected  org.springframework.amqp.core.Message doSendAndReceiveWithTemporary(java.lang.String exchange, java.lang.String routingKey, org.springframework.amqp.core.Message message)
           
<T> T
execute(ChannelCallback<T> action)
           
 org.springframework.amqp.support.converter.MessageConverter getMessageConverter()
          Return the message converter for this template.
 java.util.Collection<CorrelationData> getUnconfirmed(long age)
          Gets unconfirmed correlatiom data older than age and removes them.
 java.lang.String getUUID()
          Returns the UUID used to identify this Listener for returns.
 void handleConfirm(PendingConfirm pendingConfirm, boolean ack)
          Invoked by the channel when a confirm is received.
 void handleReturn(int replyCode, java.lang.String replyText, java.lang.String exchange, java.lang.String routingKey, com.rabbitmq.client.AMQP.BasicProperties properties, byte[] body)
           
protected  void initDefaultStrategies()
          Set up the default strategies.
protected  boolean isChannelLocallyTransacted(com.rabbitmq.client.Channel channel)
          Check whether the given Channel is locally transacted, that is, whether its transaction is managed by this template's Channel handling and not by an external transaction coordinator.
 boolean isConfirmListener()
           
 boolean isReturnListener()
           
 void onMessage(org.springframework.amqp.core.Message message)
           
 org.springframework.amqp.core.Message receive()
           
 org.springframework.amqp.core.Message receive(java.lang.String queueName)
           
 java.lang.Object receiveAndConvert()
           
 java.lang.Object receiveAndConvert(java.lang.String queueName)
           
 void removePendingConfirmsReference(com.rabbitmq.client.Channel channel, java.util.SortedMap<java.lang.Long,PendingConfirm> unconfirmed)
          When called, this listener must remove all references to the pending confirm map.
 void send(org.springframework.amqp.core.Message message)
           
 void send(java.lang.String routingKey, org.springframework.amqp.core.Message message)
           
 void send(java.lang.String exchange, java.lang.String routingKey, org.springframework.amqp.core.Message message)
           
 void send(java.lang.String exchange, java.lang.String routingKey, org.springframework.amqp.core.Message message, CorrelationData correlationData)
           
 org.springframework.amqp.core.Message sendAndReceive(org.springframework.amqp.core.Message message)
           
 org.springframework.amqp.core.Message sendAndReceive(java.lang.String routingKey, org.springframework.amqp.core.Message message)
           
 org.springframework.amqp.core.Message sendAndReceive(java.lang.String exchange, java.lang.String routingKey, org.springframework.amqp.core.Message message)
           
 void setConfirmCallback(RabbitTemplate.ConfirmCallback confirmCallback)
           
 void setCorrelationKey(java.lang.String correlationKey)
          If set to 'correlationId' (default) the correlationId property will be used; otherwise the supplied key will be used.
 void setEncoding(java.lang.String encoding)
          The encoding to use when inter-converting between byte arrays and Strings in message properties.
 void setExchange(java.lang.String exchange)
          The name of the default exchange to use for send operations when none is specified.
 void setImmediate(boolean immediate)
          Deprecated. - RabbitMQ no longer supports this option when publishing messages.
 void setMandatory(boolean mandatory)
           
 void setMessageConverter(org.springframework.amqp.support.converter.MessageConverter messageConverter)
          Set the message converter for this template.
 void setMessagePropertiesConverter(MessagePropertiesConverter messagePropertiesConverter)
          Set the MessagePropertiesConverter for this template.
 void setQueue(java.lang.String queue)
          The name of the default queue to receive messages from when none is specified explicitly.
 void setReplyQueue(org.springframework.amqp.core.Queue replyQueue)
          A queue for replies; if not provided, a temporary exclusive, auto-delete queue will be used for each reply.
 void setReplyTimeout(long replyTimeout)
          Specify the timeout in milliseconds to be used when waiting for a reply Message when using one of the sendAndReceive methods.
 void setReturnCallback(RabbitTemplate.ReturnCallback returnCallback)
           
 void setRoutingKey(java.lang.String routingKey)
          The value of a default routing key to use for send operations when none is specified.
 
Methods inherited from class org.springframework.amqp.rabbit.connection.RabbitAccessor
afterPropertiesSet, convertRabbitAccessException, createConnection, getChannel, getConnection, getConnectionFactory, getTransactionalResourceHolder, isChannelTransacted, setChannelTransacted, setConnectionFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RabbitTemplate

public RabbitTemplate()
Convenient constructor for use with setter injection. Don't forget to set the connection factory.


RabbitTemplate

public RabbitTemplate(ConnectionFactory connectionFactory)
Create a rabbit template with default strategies and settings.

Parameters:
connectionFactory - the connection factory to use
Method Detail

initDefaultStrategies

protected void initDefaultStrategies()
Set up the default strategies. Subclasses can override if necessary.


setExchange

public void setExchange(java.lang.String exchange)
The name of the default exchange to use for send operations when none is specified. Defaults to "" which is the default exchange in the broker (per the AMQP specification).

Parameters:
exchange - the exchange name to use for send operations

setRoutingKey

public void setRoutingKey(java.lang.String routingKey)
The value of a default routing key to use for send operations when none is specified. Default is empty which is not helpful when using the default (or any direct) exchange, but fine if the exchange is a headers exchange for instance.

Parameters:
routingKey - the default routing key to use for send operations

setQueue

public void setQueue(java.lang.String queue)
The name of the default queue to receive messages from when none is specified explicitly.

Parameters:
queue - the default queue name to use for receive

setEncoding

public void setEncoding(java.lang.String encoding)
The encoding to use when inter-converting between byte arrays and Strings in message properties.

Parameters:
encoding - the encoding to set

setReplyQueue

public void setReplyQueue(org.springframework.amqp.core.Queue replyQueue)
A queue for replies; if not provided, a temporary exclusive, auto-delete queue will be used for each reply.

Parameters:
replyQueue - the replyQueue to set

setReplyTimeout

public void setReplyTimeout(long replyTimeout)
Specify the timeout in milliseconds to be used when waiting for a reply Message when using one of the sendAndReceive methods. The default value is defined as DEFAULT_REPLY_TIMEOUT. A negative value indicates an indefinite timeout. Not used in the plain receive methods because there is no blocking receive operation defined in the protocol.

Parameters:
replyTimeout - the reply timeout in milliseconds
See Also:
sendAndReceive(String, String, Message), convertSendAndReceive(String, String, Object)

setMessageConverter

public void setMessageConverter(org.springframework.amqp.support.converter.MessageConverter messageConverter)
Set the message converter for this template. Used to resolve Object parameters to convertAndSend methods and Object results from receiveAndConvert methods.

The default converter is a SimpleMessageConverter, which is able to handle byte arrays, Strings, and Serializable Objects depending on the message content type header.

See Also:
convertAndSend(java.lang.Object), receiveAndConvert(), SimpleMessageConverter

setMessagePropertiesConverter

public void setMessagePropertiesConverter(MessagePropertiesConverter messagePropertiesConverter)
Set the MessagePropertiesConverter for this template. This converter is used to convert between raw byte content in the message headers and plain Java objects. In particular there are limitations when dealing with very long string headers, which hopefully are rare in practice, but if you need to use long headers you might need to inject a special converter here.


getMessageConverter

public org.springframework.amqp.support.converter.MessageConverter getMessageConverter()
Return the message converter for this template. Useful for clients that want to take advantage of the converter in ChannelCallback implementations.


setConfirmCallback

public void setConfirmCallback(RabbitTemplate.ConfirmCallback confirmCallback)

setReturnCallback

public void setReturnCallback(RabbitTemplate.ReturnCallback returnCallback)

setMandatory

public void setMandatory(boolean mandatory)

setImmediate

@Deprecated
public void setImmediate(boolean immediate)
Deprecated. - RabbitMQ no longer supports this option when publishing messages.


setCorrelationKey

public void setCorrelationKey(java.lang.String correlationKey)
If set to 'correlationId' (default) the correlationId property will be used; otherwise the supplied key will be used.

Parameters:
correlationKey - the correlationKey to set

getUnconfirmed

public java.util.Collection<CorrelationData> getUnconfirmed(long age)
Gets unconfirmed correlatiom data older than age and removes them.

Parameters:
age - in millseconds
Returns:
the collection of correlation data for which confirms have not been received.

send

public void send(org.springframework.amqp.core.Message message)
          throws org.springframework.amqp.AmqpException
Specified by:
send in interface org.springframework.amqp.core.AmqpTemplate
Throws:
org.springframework.amqp.AmqpException

send

public void send(java.lang.String routingKey,
                 org.springframework.amqp.core.Message message)
          throws org.springframework.amqp.AmqpException
Specified by:
send in interface org.springframework.amqp.core.AmqpTemplate
Throws:
org.springframework.amqp.AmqpException

send

public void send(java.lang.String exchange,
                 java.lang.String routingKey,
                 org.springframework.amqp.core.Message message)
          throws org.springframework.amqp.AmqpException
Specified by:
send in interface org.springframework.amqp.core.AmqpTemplate
Throws:
org.springframework.amqp.AmqpException

send

public void send(java.lang.String exchange,
                 java.lang.String routingKey,
                 org.springframework.amqp.core.Message message,
                 CorrelationData correlationData)
          throws org.springframework.amqp.AmqpException
Throws:
org.springframework.amqp.AmqpException

convertAndSend

public void convertAndSend(java.lang.Object object)
                    throws org.springframework.amqp.AmqpException
Specified by:
convertAndSend in interface org.springframework.amqp.core.AmqpTemplate
Throws:
org.springframework.amqp.AmqpException

correlationconvertAndSend

public void correlationconvertAndSend(java.lang.Object object,
                                      CorrelationData correlationData)
                               throws org.springframework.amqp.AmqpException
Throws:
org.springframework.amqp.AmqpException

convertAndSend

public void convertAndSend(java.lang.String routingKey,
                           java.lang.Object object)
                    throws org.springframework.amqp.AmqpException
Specified by:
convertAndSend in interface org.springframework.amqp.core.AmqpTemplate
Throws:
org.springframework.amqp.AmqpException

convertAndSend

public void convertAndSend(java.lang.String routingKey,
                           java.lang.Object object,
                           CorrelationData correlationData)
                    throws org.springframework.amqp.AmqpException
Throws:
org.springframework.amqp.AmqpException

convertAndSend

public void convertAndSend(java.lang.String exchange,
                           java.lang.String routingKey,
                           java.lang.Object object)
                    throws org.springframework.amqp.AmqpException
Specified by:
convertAndSend in interface org.springframework.amqp.core.AmqpTemplate
Throws:
org.springframework.amqp.AmqpException

convertAndSend

public void convertAndSend(java.lang.String exchange,
                           java.lang.String routingKey,
                           java.lang.Object object,
                           CorrelationData corrationData)
                    throws org.springframework.amqp.AmqpException
Throws:
org.springframework.amqp.AmqpException

convertAndSend

public void convertAndSend(java.lang.Object message,
                           org.springframework.amqp.core.MessagePostProcessor messagePostProcessor)
                    throws org.springframework.amqp.AmqpException
Specified by:
convertAndSend in interface org.springframework.amqp.core.AmqpTemplate
Throws:
org.springframework.amqp.AmqpException

convertAndSend

public void convertAndSend(java.lang.String routingKey,
                           java.lang.Object message,
                           org.springframework.amqp.core.MessagePostProcessor messagePostProcessor)
                    throws org.springframework.amqp.AmqpException
Specified by:
convertAndSend in interface org.springframework.amqp.core.AmqpTemplate
Throws:
org.springframework.amqp.AmqpException

convertAndSend

public void convertAndSend(java.lang.String routingKey,
                           java.lang.Object message,
                           org.springframework.amqp.core.MessagePostProcessor messagePostProcessor,
                           CorrelationData correlationData)
                    throws org.springframework.amqp.AmqpException
Throws:
org.springframework.amqp.AmqpException

convertAndSend

public void convertAndSend(java.lang.String exchange,
                           java.lang.String routingKey,
                           java.lang.Object message,
                           org.springframework.amqp.core.MessagePostProcessor messagePostProcessor)
                    throws org.springframework.amqp.AmqpException
Specified by:
convertAndSend in interface org.springframework.amqp.core.AmqpTemplate
Throws:
org.springframework.amqp.AmqpException

convertAndSend

public void convertAndSend(java.lang.String exchange,
                           java.lang.String routingKey,
                           java.lang.Object message,
                           org.springframework.amqp.core.MessagePostProcessor messagePostProcessor,
                           CorrelationData correlationData)
                    throws org.springframework.amqp.AmqpException
Throws:
org.springframework.amqp.AmqpException

receive

public org.springframework.amqp.core.Message receive()
                                              throws org.springframework.amqp.AmqpException
Specified by:
receive in interface org.springframework.amqp.core.AmqpTemplate
Throws:
org.springframework.amqp.AmqpException

receive

public org.springframework.amqp.core.Message receive(java.lang.String queueName)
Specified by:
receive in interface org.springframework.amqp.core.AmqpTemplate

receiveAndConvert

public java.lang.Object receiveAndConvert()
                                   throws org.springframework.amqp.AmqpException
Specified by:
receiveAndConvert in interface org.springframework.amqp.core.AmqpTemplate
Throws:
org.springframework.amqp.AmqpException

receiveAndConvert

public java.lang.Object receiveAndConvert(java.lang.String queueName)
                                   throws org.springframework.amqp.AmqpException
Specified by:
receiveAndConvert in interface org.springframework.amqp.core.AmqpTemplate
Throws:
org.springframework.amqp.AmqpException

sendAndReceive

public org.springframework.amqp.core.Message sendAndReceive(org.springframework.amqp.core.Message message)
                                                     throws org.springframework.amqp.AmqpException
Specified by:
sendAndReceive in interface org.springframework.amqp.core.AmqpTemplate
Throws:
org.springframework.amqp.AmqpException

sendAndReceive

public org.springframework.amqp.core.Message sendAndReceive(java.lang.String routingKey,
                                                            org.springframework.amqp.core.Message message)
                                                     throws org.springframework.amqp.AmqpException
Specified by:
sendAndReceive in interface org.springframework.amqp.core.AmqpTemplate
Throws:
org.springframework.amqp.AmqpException

sendAndReceive

public org.springframework.amqp.core.Message sendAndReceive(java.lang.String exchange,
                                                            java.lang.String routingKey,
                                                            org.springframework.amqp.core.Message message)
                                                     throws org.springframework.amqp.AmqpException
Specified by:
sendAndReceive in interface org.springframework.amqp.core.AmqpTemplate
Throws:
org.springframework.amqp.AmqpException

convertSendAndReceive

public java.lang.Object convertSendAndReceive(java.lang.Object message)
                                       throws org.springframework.amqp.AmqpException
Specified by:
convertSendAndReceive in interface org.springframework.amqp.core.AmqpTemplate
Throws:
org.springframework.amqp.AmqpException

convertSendAndReceive

public java.lang.Object convertSendAndReceive(java.lang.String routingKey,
                                              java.lang.Object message)
                                       throws org.springframework.amqp.AmqpException
Specified by:
convertSendAndReceive in interface org.springframework.amqp.core.AmqpTemplate
Throws:
org.springframework.amqp.AmqpException

convertSendAndReceive

public java.lang.Object convertSendAndReceive(java.lang.String exchange,
                                              java.lang.String routingKey,
                                              java.lang.Object message)
                                       throws org.springframework.amqp.AmqpException
Specified by:
convertSendAndReceive in interface org.springframework.amqp.core.AmqpTemplate
Throws:
org.springframework.amqp.AmqpException

convertSendAndReceive

public java.lang.Object convertSendAndReceive(java.lang.Object message,
                                              org.springframework.amqp.core.MessagePostProcessor messagePostProcessor)
                                       throws org.springframework.amqp.AmqpException
Specified by:
convertSendAndReceive in interface org.springframework.amqp.core.AmqpTemplate
Throws:
org.springframework.amqp.AmqpException

convertSendAndReceive

public java.lang.Object convertSendAndReceive(java.lang.String routingKey,
                                              java.lang.Object message,
                                              org.springframework.amqp.core.MessagePostProcessor messagePostProcessor)
                                       throws org.springframework.amqp.AmqpException
Specified by:
convertSendAndReceive in interface org.springframework.amqp.core.AmqpTemplate
Throws:
org.springframework.amqp.AmqpException

convertSendAndReceive

public java.lang.Object convertSendAndReceive(java.lang.String exchange,
                                              java.lang.String routingKey,
                                              java.lang.Object message,
                                              org.springframework.amqp.core.MessagePostProcessor messagePostProcessor)
                                       throws org.springframework.amqp.AmqpException
Specified by:
convertSendAndReceive in interface org.springframework.amqp.core.AmqpTemplate
Throws:
org.springframework.amqp.AmqpException

convertMessageIfNecessary

protected org.springframework.amqp.core.Message convertMessageIfNecessary(java.lang.Object object)

doSendAndReceive

protected org.springframework.amqp.core.Message doSendAndReceive(java.lang.String exchange,
                                                                 java.lang.String routingKey,
                                                                 org.springframework.amqp.core.Message message)
Send a message and wait for a reply.

Parameters:
exchange - the exchange name
routingKey - the routing key
message - the message to send
Returns:
the message that is received in reply

doSendAndReceiveWithTemporary

protected org.springframework.amqp.core.Message doSendAndReceiveWithTemporary(java.lang.String exchange,
                                                                              java.lang.String routingKey,
                                                                              org.springframework.amqp.core.Message message)

doSendAndReceiveWithFixed

protected org.springframework.amqp.core.Message doSendAndReceiveWithFixed(java.lang.String exchange,
                                                                          java.lang.String routingKey,
                                                                          org.springframework.amqp.core.Message message)

execute

public <T> T execute(ChannelCallback<T> action)
Specified by:
execute in interface RabbitOperations

doSend

protected void doSend(com.rabbitmq.client.Channel channel,
                      java.lang.String exchange,
                      java.lang.String routingKey,
                      org.springframework.amqp.core.Message message,
                      CorrelationData correlationData)
               throws java.lang.Exception
Send the given message to the specified exchange.

Parameters:
channel - the RabbitMQ Channel to operate within
exchange - the name of the RabbitMQ exchange to send to
routingKey - the routing key
message - the Message to send
Throws:
java.io.IOException - if thrown by RabbitMQ API methods
java.lang.Exception

isChannelLocallyTransacted

protected boolean isChannelLocallyTransacted(com.rabbitmq.client.Channel channel)
Check whether the given Channel is locally transacted, that is, whether its transaction is managed by this template's Channel handling and not by an external transaction coordinator.

Parameters:
channel - the Channel to check
Returns:
whether the given Channel is locally transacted
See Also:
ConnectionFactoryUtils.isChannelTransactional(com.rabbitmq.client.Channel, org.springframework.amqp.rabbit.connection.ConnectionFactory), RabbitAccessor.isChannelTransacted()

handleConfirm

public void handleConfirm(PendingConfirm pendingConfirm,
                          boolean ack)
Description copied from interface: PublisherCallbackChannel.Listener
Invoked by the channel when a confirm is received.

Specified by:
handleConfirm in interface PublisherCallbackChannel.Listener
Parameters:
pendingConfirm - The pending confirmation, containing correlation data.
ack - true when 'ack', false when 'nack'.

handleReturn

public void handleReturn(int replyCode,
                         java.lang.String replyText,
                         java.lang.String exchange,
                         java.lang.String routingKey,
                         com.rabbitmq.client.AMQP.BasicProperties properties,
                         byte[] body)
                  throws java.io.IOException
Specified by:
handleReturn in interface PublisherCallbackChannel.Listener
Throws:
java.io.IOException

isConfirmListener

public boolean isConfirmListener()
Specified by:
isConfirmListener in interface PublisherCallbackChannel.Listener

isReturnListener

public boolean isReturnListener()
Specified by:
isReturnListener in interface PublisherCallbackChannel.Listener

removePendingConfirmsReference

public void removePendingConfirmsReference(com.rabbitmq.client.Channel channel,
                                           java.util.SortedMap<java.lang.Long,PendingConfirm> unconfirmed)
Description copied from interface: PublisherCallbackChannel.Listener
When called, this listener must remove all references to the pending confirm map.

Specified by:
removePendingConfirmsReference in interface PublisherCallbackChannel.Listener
unconfirmed - The pending confirm map.

getUUID

public java.lang.String getUUID()
Description copied from interface: PublisherCallbackChannel.Listener
Returns the UUID used to identify this Listener for returns.

Specified by:
getUUID in interface PublisherCallbackChannel.Listener
Returns:
A string representation of the UUID.

onMessage

public void onMessage(org.springframework.amqp.core.Message message)
Specified by:
onMessage in interface org.springframework.amqp.core.MessageListener