top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What are the different types of exchange supported by RabbitMQ and why those are required ?

+1 vote
293 views
What are the different types of exchange supported by RabbitMQ and why those are required ?
posted Jan 28, 2017 by Neelam

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

RabbitMQ is a kind of AMQP (Advanced Messaging Queuing Protocol) which is used for inter process communication. RabbitMQ is better than normal linux message queue mechanism. RabbitMQ uses publisher/producer and consumer same as normal queuing mechanism but it also support various concepts such as broker/exchange and bindings.
Mainly four types of exchanges have been defined as following:

  1. Direct Exchange : In this case publisher/producer sends a message to exchange with the key "K" and if a queue binds to the exchange with routing key "K" then the message is routed to the queue. This kind of exchange is useful in case of unicasting.

  2. Fanout Exchange: In this case, when a message is published to exchange then copy of message is delivered to all the bounded queues ignoring the key. Mainly it is used for broadcasting the message to all the consumers.

  3. Topic Exchange: In this case, a message produced by a producer can be routed to multiple queues based on the pattern used while binding queue with exchange. It is kind of multi-casting.

  4. Header Exchange: In case of header exchange, message is routed to different queues based on the message attributes rather than using routing key.

This is all about exchange/broker what I know in the context of AMQP.

answer Jan 28, 2017 by Harshita
...