Spring RabbitMQ cheat sheet

From DarkWiki
Revision as of 16:20, 2 April 2020 by Apowney (talk | contribs) (Created page with "===Sending to topics=== On the ''Producer'' side (the one that raises the events) we create our TopicExchange, giving it a sensible name: <source lang="java"> import org.spr...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Sending to topics

On the Producer side (the one that raises the events) we create our TopicExchange, giving it a sensible name:

import org.springframework.amqp.core.TopicExchange;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class EventProducerConfig {

    @Bean("eventExchange")
    public TopicExchange eventExchange() {
        return new TopicExchange("eventExchange");
    }

}