Example usage for org.springframework.amqp.core AmqpTemplate convertAndSend

List of usage examples for org.springframework.amqp.core AmqpTemplate convertAndSend

Introduction

In this page you can find the example usage for org.springframework.amqp.core AmqpTemplate convertAndSend.

Prototype

void convertAndSend(Object message) throws AmqpException;

Source Link

Document

Convert a Java object to an Amqp Message and send it to a default exchange with a default routing key.

Usage

From source file:acromusashi.stream.component.rabbitmq.DefaultRabbitmqClient.java

/**
 * ??//w  w  w  .j av  a  2s. co m
 * 
 * @param template ???
 * @param message 
 * @throws InterruptedException ?????
 */
private void sendAndRetry(AmqpTemplate template, Object message) throws InterruptedException {
    try {
        template.convertAndSend(message);
    } catch (AmqpException ex) {
        Thread.sleep(getRetryInterval());
        template.convertAndSend(message);
    }
}