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

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

Introduction

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

Prototype

public ExchangeBuilder(String name, String type) 

Source Link

Document

Construct an instance of the appropriate type.

Usage

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

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