⟵ Posts

Mirrored Queues in RabbitMQ

11 Jul 2021

Prior to RabbitMQ 3.8, the best way to achieve high-availability and data-safety with RabbitMQ was to set-up a cluster and mirror the queues across mutliple nodes. With the release of Quorum Queues in RabbitMQ 3.8, “classic style” mirrored queues are no longer the best choice for high-availability in a RabbitMQ cluster.

Configuring mirrored queues in RabbitMQ is cumbersome and setting up HAProxy for long-lived TCP connections is non-trivial. These Ansible Playbooks simplify setting up the proxy and RabbitMQ. The cluster is front-ed with a HAProxy instance that’s configured to support long-lived TCP connections. The cluster itself is a two node cluster that’s configured to mirror all queues to all nodes.

The repo has the bare minimum configuration needed to demonstrate clustering queues in RabbitMQ and proxying with HAProxy. It also includes a Vagrantfile and two python scripts to build and test the cluster locally.