From the course: Learning RabbitMQ: Efficient Message Queuing
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
The exchange types - RabbitMQ Tutorial
From the course: Learning RabbitMQ: Efficient Message Queuing
The exchange types
- [Instructor] Let's have a look at the different types of exchanges that exist in RabbitMQ. There are four different types of exchanges, direct, fanout, topic, and headers. Each of these types will handle messages and routing keys differently. The direct exchange will route messages to all queues that have been connected to this exchange with the same routing key as the routing key that the publisher used. In this example, the publisher used the routing key customer.purchase. Let's assume that there are two queues that have been bound to this exchange, one with the routing key customer.purchase and the other with customer.registration. Direct exchange will now route the message to the queue with the customer.purchase routing key. The other queue will not receive the message. In the case of a fanout exchange, messages are routed to all bound queues and the routing key is just ignored. Every queue will receive a copy of the…