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

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

Introduction

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

Prototype

@SuppressWarnings("unchecked")
    public <T extends Exchange> T build() 

Source Link

Usage

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

private Exchange buildExchange(RabbitCommonProperties properties, String exchangeName) {
    try {/*from  ww  w.  j  av  a 2  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);
    }
}