Example usage for org.springframework.amqp.core Address AMQ_RABBITMQ_REPLY_TO

List of usage examples for org.springframework.amqp.core Address AMQ_RABBITMQ_REPLY_TO

Introduction

In this page you can find the example usage for org.springframework.amqp.core Address AMQ_RABBITMQ_REPLY_TO.

Prototype

String AMQ_RABBITMQ_REPLY_TO

To view the source code for org.springframework.amqp.core Address AMQ_RABBITMQ_REPLY_TO.

Click Source Link

Document

Use this value in RabbitTemplate#setReplyAddress(String) to explicitly indicate that direct reply-to is to be used.

Usage

From source file:org.springframework.amqp.rabbit.AsyncRabbitTemplate.java

private void sendDirect(Channel channel, String exchange, String routingKey, Message message,
        CorrelationData correlationData) {
    message.getMessageProperties().setReplyTo(Address.AMQ_RABBITMQ_REPLY_TO);
    try {/*from  w w  w. j  a v a  2s. co m*/
        if (channel instanceof PublisherCallbackChannel) {
            this.template.addListener(channel);
        }
        this.template.doSend(channel, exchange, routingKey, message, this.template.isMandatoryFor(message),
                correlationData);
    } catch (Exception e) {
        throw new AmqpException("Failed to send request", e);
    }
}