Junior — Middle
Какова роль и назначение компонента direct exchange в RabbitMQ?
sobes.tech AI
Answer from AI
Direct exchange in RabbitMQ is a type of exchange that routes messages to queues based on an exact match of the routing key. When a message is published to a direct exchange, it is delivered only to those queues that are bound to this exchange with a binding key matching the message's routing key.
This is useful when you need to direct messages strictly to specific queues based on particular keys, ensuring point-to-point delivery.
Example: if you have a queue bound with the key "error", then a message with routing key "error" will go exactly to this queue, but a message with key "info" will not.