Skip to content

Lesson 7 of 9 · 26m

Quorum Queues, Clustering, and Placement Decisions

Choose queue types intentionally, understand quorum replication and leadership, and avoid treating a RabbitMQ cluster as a transparent distributed queue.

A RabbitMQ cluster is not one big magical queue spread evenly across machines. Queue types and placement matter. Classic queues historically had confusing mirroring behavior; modern production RabbitMQ points you toward quorum queues for replicated data safety. If you are designing a new system today, quorum queues are the default answer for business-critical work unless you have a specific reason otherwise.

What a quorum queue gives you

A quorum queue uses Raft replication. A leader handles operations and followers replicate the log. A majority must agree, which means the queue remains available when a minority of nodes is lost but not when quorum is lost.

channel.queue_declare(
    queue="orders.invoice",
    durable=True,
    arguments={
        "x-queue-type": "quorum",
        "x-delivery-limit": 5,
    },
)

Or with a policy:

rabbitmqctl set_policy orders-quorum '^orders[.]'   '{"queue-type":"quorum","delivery-limit":5}'   --apply-to queues

This gives replicated storage, redelivery counting, and predictable safety semantics. It also costs more than a single-node classic queue because replication and consensus are real work.

Cluster membership is not queue replication

Joining three nodes into a cluster does not automatically replicate every queue. A non-mirrored classic queue is still owned by one node even if metadata is visible cluster-wide. If that node disappears, the queue's messages may be unavailable. This is the mental mistake behind many emergency bridge chats.

Use this rule of thumb:

business-critical, cannot lose or pause work   -> quorum queue
high-throughput transient work                 -> classic queue may be acceptable
single consumer transient reply queue          -> classic/exclusive semantics can fit

Do not convert everything blindly. Replication costs throughput, disk, and network capacity. Spend it where durability matters.

Classic mirrored queues are legacy

Classic queue mirroring has been deprecated in modern RabbitMQ because its failover and synchronization semantics were difficult and often surprising. If you inherit mirrored classic queues, plan migration rather than adding more complexity. Migration usually means creating quorum queues, moving consumers and bindings, draining old queues, then removing legacy topology.

rabbitmqctl list_queues name type policy messages consumers

Know what you actually run. Many clusters contain a mixture created by different generations of deployment code.

Placement and capacity are operational decisions

Quorum queues have leaders distributed across cluster members, but not automatically in a way that matches your disk and network layout. Watch per-node load:

rabbitmqctl list_queues name node leader members messages memory
rabbitmqctl node_health_check

A cluster with plenty of aggregate capacity can still have one hot node because several busy quorum leaders landed there. Adding consumers does not fix storage or replication imbalance.

Availability is not the same as durability

Quorum replication improves survival of node failure, but losing quorum makes the queue unavailable rather than silently inconsistent. That is a feature. For a three-node group, one node can fail and majority remains. Two failures mean no majority. If your business needs cross-site availability during a full site loss, a single stretched cluster is usually the wrong answer; look at separate clusters, application-level failover, shovel, or federation with careful duplication semantics.

Field notes

  • Quorum queues do not support every classic-queue feature; verify TTL, priority, and behavior expectations before migration.
  • Three or five voting members are normal quorum shapes; two-node quorum arrangements have poor failure economics.
  • Policies apply to future queue declarations or matching queues depending on scope; do not assume editing a policy retroactively rewrites the world.
  • Cluster upgrades are queue-data operations, not just binary upgrades. Read the RabbitMQ release notes for mixed-version and feature-flag requirements.

Was this lesson helpful?

Sign in to rate