Fanout exchange in RabbitMQ

Experienced Full Stack Java developer. Have Strong Experience in JSP/Servlet, JSF, Jasper Report, Spring Framework, hibernate, Angular 5+, Microservices. Experienced in Front-end technologies such as HTML, CSS, JavaScript, angular 6+, AJAX, JSON, and XML. Strong Hands-on experience on working with Reactive Forms to build form-based application in Angular 6+.
Unlike Direct Exchange, Fanout exchange routes the messages to all the queues bound to it.
That's why it doesn't need a routing key

How to Create Fanout Exchange ?
Login to RabbitMQ web UI.
Go to "Exchanges" and click on "Add new exchange"
Provide exchange name and from drop down select "fanout"
click on "Add Exchange" to save it.

Then go to list of exchanges and click on your fanout exchange to bind it with queues.
provide queue name you want to bind. This time you don't have to provide routing key.

Now lets see in practical. I have bounded my "fanout-exchange" to my "xml" and "excel" queue.
let me publish my message.

After publishing, we have message in both the Queue

lets start the consumer.
- started the excel consumer and it got the message.

started the xml consumer and it also got the message.

This is all about fanout exchange, in the next blog we will learn more about RabbitMQ.




