List of usage examples for org.springframework.amqp.core FanoutExchange FanoutExchange
public FanoutExchange(String name, boolean durable, boolean autoDelete)
From source file:com.nkapps.billing.configs.RabbitMQConfig.java
@Bean public FanoutExchange accountManagerExchange() { return new FanoutExchange(BILLING_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 {/* www . ja v a 2s. c om*/
return new DirectExchange(this.exchangeName, this.durable, this.autodelete);
}
}
From source file:vn.topmedia.monitor.MonitorAppender.java
/** * Maybe declare the exchange./* w w w .j a v a 2s . 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); } }