RabbitMQ clusters are designed to improve scalability, but the system is not fully automatic.
When you declare a queue in a node in a cluster , the queue is created only on that node . So, if you have one queue, no matter which node you publish, the message will end on the node where the queue is.
To use RabbitMQ clusters correctly, you need to make sure that you are following these steps:
- have several queues distributed over nodes, so that work is distributed evenly,
- connect your clients to different nodes (otherwise you can complete all messages through one node) and
- if you want, try connecting publishers / consumers to a node that contains the queue it uses (to minimize message transfer within the cluster).
Also, see High Availability Queues . They look like regular queues, but the contents of the queue are mirrored on multiple nodes. Thus, in your case, you will publish one of the node, RabbitMQ will reflect the publication of the other node, and consumers will be able to connect to the node without worrying about linking the cluster to internal translations.
source share