We are rebuilding our message queuing system. Passing on the types of RabbitMQ exchange, I noticed that there are two possible solutions for implementing multiprocessor routing messages.
Exchange Theme. By setting up a topic exchange and a routing key with a specific template, the message will be redirected to the designated queues. I.E. products. *. According to the AMQP specification, this is usually the type of exchange for implementing the Pub / Sub pattern.
Header sharing. The so-called "Direct exchange for steroids." This is even more flexible for multiple messages in this routing key is ignored; instead, each message has an βx-matchβ header to indicate which queues should be sent to the message. And each message can be dynamically routed differently. However, this type of exchange may seem a little more closely related to the design of the message queue, as the consumer / producer will need to learn more about the destination queues.
So, the question is, does anyone have experience with both types of exchange and have more general characteristics of the pros and cons for the two above types? Thanks!
Link [1]: https://www.rabbitmq.com/tutorials/amqp-concepts.html
source share