In RabbitMQ, a producer never sends a message directly to a queue. Instead, it uses an exchange as a routing mediator.
Therefore, the exchange decides if the message goes to one queue, to multiple queues, or is simply discarded.
For instance, depending on the routing strategy, we have four exchange types to choose from:
Direct – the exchange forwards the message to a queue based on a routing key
Fanout – the exchange ignores the routing key and forwards the message to all bounded queues
Topic – the exchange routes the message to bounded queues using the match between a pattern defined on the exchange and the routing keys attached to the queues
Headers – in this case, the message header attributes are used, instead of the routing key, to bind an exchange to one or more queues
https://www.baeldung.com/java-rabbitmq-exchanges-queues-bindings