RabbitMQ Exchanges


Whenever message producer generate a message for consumer that will never sent directly to the queue. Instead of it will send first to Respective RabbitMQ exchange then routing agent will read header attributes and send this data to appropriate RabbitMQ queue.

Different types of RabbitMQ exchange:

  • Direct
  • Fanout
  • Topic

RabbitMQ Direct Exchange:

In Direct exchange, exchange will send a message to respective queue which is bind with exactly matches routing key.

Following is the picture representation of msg flow in Direct RabbitMQ exchange:

RabbitMQ Direct Exchange

RabbitMQ Fanout Exchange:

In this RabbitMQ exchange, messages will be routed to all the queues which are bounded to it.

Following is the picture representation of msg flow in Fanout RabbitMQ exchange:

RabbitMQ Fanout Exchange

RabbitMQ Topic Exchange:

In this RabbitMQ exchange process a wild card matches will perform between routing key and routing pattern which is mentioned in binding for publish message to the queue.

Following is the picture representation of msg flow in Topic RabbitMQ exchange:

RabbitMQ Topic Exchange

How to create RabbitMQ Exchange


%d bloggers like this: