Search in sources :

Example 1 with FanoutExchange

use of org.springframework.amqp.core.FanoutExchange in project spring-integration by spring-projects.

the class PublishSubscribeAmqpChannel method obtainQueueName.

@Override
protected String obtainQueueName(String channelName) {
    if (this.exchange == null) {
        String exchangeName = "si.fanout." + channelName;
        this.exchange = new FanoutExchange(exchangeName);
    }
    this.binding = BindingBuilder.bind(this.queue).to(this.exchange);
    return this.queue.getName();
}
Also used : FanoutExchange(org.springframework.amqp.core.FanoutExchange)

Example 2 with FanoutExchange

use of org.springframework.amqp.core.FanoutExchange in project tutorials by eugenp.

the class BroadcastConfig method fanoutBindings.

@Bean
public List<Declarable> fanoutBindings() {
    Queue fanoutQueue1 = new Queue(fanoutQueue1Name, false);
    Queue fanoutQueue2 = new Queue(fanoutQueue2Name, false);
    FanoutExchange fanoutExchange = new FanoutExchange(fanoutExchangeName);
    return Arrays.asList(fanoutQueue1, fanoutQueue2, fanoutExchange, BindingBuilder.bind(fanoutQueue1).to(fanoutExchange), BindingBuilder.bind(fanoutQueue2).to(fanoutExchange));
}
Also used : Queue(org.springframework.amqp.core.Queue) FanoutExchange(org.springframework.amqp.core.FanoutExchange) Bean(org.springframework.context.annotation.Bean)

Aggregations

FanoutExchange (org.springframework.amqp.core.FanoutExchange)2 Queue (org.springframework.amqp.core.Queue)1 Bean (org.springframework.context.annotation.Bean)1