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

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

Introduction

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

Prototype

public TopicExchange(String name, boolean durable, boolean autoDelete) 

Source Link

Usage

From source file:io.acme.solution.api.conf.RabbitConfigurer.java

@Bean
public TopicExchange commandExchange() {
    log.info("Creating a durable topic exchange for the command bus with name: {" + this.exchange
            + "} and auto-delete is: {" + this.deletable + "}");

    return new TopicExchange(this.exchange, true, this.deletable);
}

From source file:io.acme.solution.infrastructure.conf.EventBusConfigurer.java

@Bean
public TopicExchange eventExchange() {

    log.info("Creating event bus topic exchange with the name : {" + this.exchange + "}");
    return new TopicExchange(this.exchange, true, false);
}

From source file:com.jbrisbin.vpc.jobsched.QueueConfiguration.java

@Bean
public TopicExchange exchange() {
    TopicExchange x = new TopicExchange(exchangeName, true, false);
    return x;
}

From source file:io.acme.solution.query.conf.EventBusConfigurer.java

@Bean
public TopicExchange eventExchange() {

    log.info("Creating query event bus topic exchange with the name : {" + this.exchange + "}");
    return new TopicExchange(this.exchange, true, false);
}

From source file:io.acme.solution.application.conf.CommandBusConfigurer.java

@Bean
public TopicExchange commandExchange() {

    log.info("Creating command bus topic exchange with the name : {" + this.exchange + "}");
    return new TopicExchange(this.exchange, true, false);
}

From source file:amqp.spring.camel.component.SpringAMQPEndpoint.java

org.springframework.amqp.core.Exchange createAMQPExchange() {
    if ("direct".equals(this.exchangeType)) {
        return new DirectExchange(this.exchangeName, this.durable, this.autodelete);
    } else if ("fanout".equals(this.exchangeType)) {
        return new FanoutExchange(this.exchangeName, this.durable, this.autodelete);
    } else if ("headers".equals(this.exchangeType)) {
        return new HeadersExchange(this.exchangeName, this.durable, this.autodelete);
    } else if ("topic".equals(this.exchangeType)) {
        return new TopicExchange(this.exchangeName, this.durable, this.autodelete);
        //We have a routing key but no explicit exchange type, assume topic exchange
    } else if (this.routingKey != null) {
        return new TopicExchange(this.exchangeName, this.durable, this.autodelete);
    } else {/*from  w  w  w .  ja v a  2 s.  c  o  m*/
        return new DirectExchange(this.exchangeName, this.durable, this.autodelete);
    }
}

From source file:vn.topmedia.monitor.MonitorAppender.java

/**
 * Maybe declare the exchange.//from ww  w  . j a  v  a2  s  .c o  m
 */
protected void maybeDeclareExchange() {
    RabbitAdmin admin = new RabbitAdmin(connectionFactory);
    if (declareExchange) {
        Exchange x;
        if ("topic".equals(exchangeType)) {
            x = new TopicExchange(exchangeName, durable, autoDelete);
        } else if ("direct".equals(exchangeType)) {
            x = new DirectExchange(exchangeName, durable, autoDelete);
        } else if ("fanout".equals(exchangeType)) {
            x = new FanoutExchange(exchangeName, durable, autoDelete);
        } else if ("headers".equals(exchangeType)) {
            x = new HeadersExchange(exchangeType, durable, autoDelete);
        } else {
            x = new TopicExchange(exchangeName, durable, autoDelete);
        }
        admin.declareExchange(x);
    }
}