rabbitmqmessage-queueamqpinfrastructurerabbitmq-exchange

Load balancing for RabbitMQ server (broker), not the consumers(clients)


In this example I have a setup of 2 consumers and 2 publishers in my network. The centre is a RabbitMQ broker as shown in the screenshot below. Due to fail-safe reasons, I am wondering if RabbitMQ supports load-balancing or mirroring of the server (broker) in any way. I just would like to get rid of the star topology for two reasons:

1) If one broker fails, another publisher can take over immediately

2) If one brokers network throughput is not good enough the other takes over

Solving one or the other (or even both) would be great.

My current infrastructure enter image description here

Preferred infrastructure enter image description here


Solution

  • RabbitMQ clustering (docs) can meet your first requirement. Use three nodes and be sure your applications are coded and tested to take failure scenarios into account.

    I don't know of anything out-of-the-box that can meet your second requirement. You will have to implement something that uses cluster statistics or application statistics to determine when to switch to another cluster due to lower throughput.