Example usage for org.springframework.amqp.core ExchangeBuilder autoDelete

List of usage examples for org.springframework.amqp.core ExchangeBuilder autoDelete

Introduction

In this page you can find the example usage for org.springframework.amqp.core ExchangeBuilder autoDelete.

Prototype

boolean autoDelete

To view the source code for org.springframework.amqp.core ExchangeBuilder autoDelete.

Click Source Link

Usage

From source file:org.springframework.cloud.stream.binder.rabbit.provisioning.RabbitExchangeQueueProvisioner.java

private Exchange buildExchange(RabbitCommonProperties properties, String exchangeName) {
    try {/*from   www. jav  a2 s.  c o m*/
        ExchangeBuilder builder = new ExchangeBuilder(exchangeName, properties.getExchangeType());
        builder.durable(properties.isExchangeDurable());
        if (properties.isExchangeAutoDelete()) {
            builder.autoDelete();
        }
        if (properties.isDelayedExchange()) {
            builder.delayed();
        }
        return builder.build();
    } catch (Exception e) {
        throw new ProvisioningException("Failed to create exchange object", e);
    }
}