Quick revision
The short answer
We first build an inventory of every mirrored queue, its arguments and policies, and the services that declare it, then check each feature against what quorum queues support in our target version. Because a queue's type cannot be changed in place, we create new quorum queues next to the old ones, change each service's declarations, move producers and consumers service by service while the old queues drain, and test failover and dead-lettering on quorum queues before we upgrade the cluster to 4.0.
What to remember
In this answer, we planned the move from classic mirrored queues to quorum queues before a RabbitMQ 4.0 upgrade. We built an inventory of queues, arguments, policies and owning services, checked the features that behave differently such as the delivery limit and dead-lettering strategy, created new quorum queues next to the old ones, changed each service's declarations, moved consumers once the old queues drained, and tested failover and dead-lettering in a test cluster before upgrading production.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
We first build an inventory of every mirrored queue, its arguments and policies, and the services that declare it, then check each feature against what quorum queues support in our target version. Because a queue's type cannot be changed in place, we create new quorum queues next to the old ones, change each service's declarations, move producers and consumers service by service while the old queues drain, and test failover and dead-lettering on quorum queues before we upgrade the cluster to 4.0.
Why this question is asked
Classic queue mirroring was the old way to keep a RabbitMQ queue available when a node failed. RabbitMQ 4.0 removed it, so a cluster that still relies on it cannot simply be upgraded: the queues would lose the replication the services count on. With forty services and many dead-letter settings, this is not a configuration change but a migration project, and interviewers ask it to see whether we can plan one safely. In this answer, we will recap what mirrored and quorum queues are, build the inventory, check the feature differences that bite, walk through the per-service move, and finish with the tests we run before the cluster upgrade.
1A Quick Recap of Mirrored and Quorum Queues
A queue in RabbitMQ lives on one node, its leader. With classic mirroring, a policy (a rule the broker applies to every queue whose name matches a pattern) told RabbitMQ to keep copies of the queue on other nodes. If the leader died, a mirror took over. Mirroring had well-known problems: synchronising a large queue to a new mirror could block it, and network partitions could lose messages.
A quorum queue is the replacement. It is replicated with the Raft consensus protocol: a message is confirmed to the publisher only after a majority of the replicas have written it. With three replicas, the queue survives the loss of one node without losing confirmed messages. Quorum queues are always durable, and the type is chosen when the queue is declared, with the argument x-queue-type=quorum.
That last detail shapes the whole plan. A policy cannot turn an existing classic queue into a quorum queue, and declaring an existing queue again with a different type fails with a PRECONDITION_FAILED error. So migrating means creating new queues, not editing old ones.
2Build the Inventory
We cannot plan forty services from memory. We list every queue with its type, arguments and the policy applied to it, and every policy definition, from the management HTTP API or the command line.
For each queue we record the dead-letter exchange and routing key, the message TTL (time to live, after which a message expires), length limits and the overflow behaviour, priorities, whether it is exclusive or auto-delete, and which service declares it. The last column is the hardest: we find it by searching the code for queue declarations (in Spring AMQP, Queue beans and QueueBuilder calls) and by matching the consumer connection names the management UI shows. The migration has to carry settings from both code and policies.
3Check the Features That Behave Differently
Quorum queues cover most of what classic queues do, but not everything, and some features behave differently. The table shows the ones that usually matter. The details have changed between releases, so we confirm each row against the documentation for our exact target version.
| Feature | Classic mirrored | Quorum (check your version) |
|---|---|---|
| Replication | ha-mode policy | Raft, set at declaration |
| Durability | durable or not | always durable |
| Exclusive or auto-delete | supported | not supported |
| Redelivery limit | none | delivery limit, default 20 in 4.0 |
| Dead-lettering | at-most-once | at-most-once or at-least-once |
| Priorities | x-max-priority levels | limited support in 4.x |
| Overflow reject-publish-dlx | supported | not supported |
Two rows deserve attention. Since 4.0 a quorum queue has a delivery limit by default (20 redeliveries in 4.0), after which a message is dead-lettered or dropped. A consumer that rejects and requeues forever on a classic queue will now see messages leave the queue, which is usually good but must be expected. And dead-lettering from a quorum queue is at-most-once by default; for the queues where losing a dead-lettered message is not acceptable, we choose the at-least-once strategy, which requires the reject-publish overflow setting.
Anything that has no equivalent, such as a non-durable or exclusive queue, stays a classic queue. Plain classic queues still exist in 4.0; only mirroring was removed.
4Move Service by Service
With the inventory in hand, we migrate one service at a time. For each queue we declare a new quorum queue, usually under a new name such as orders.payment.q, with the same dead-letter and TTL settings. The service's own declarations must change too: Spring's RabbitAdmin declares queues at startup, and if the code still declares the old classic queue, a restart recreates it or fails on mismatched arguments.
- Declare the new quorum queuesame DLX, TTL and limits
- Bind it to the same exchangenew messages reach both queues
- Deploy consumers on the new queueidempotent, since copies overlap
- Old queue drained to zero?YesUnbind and delete itNoWait, or shovel the backlog
- Remove old declarations from codeso no restart recreates it
5 steps in order. Play them, or step through them one at a time.
The order of the cutover matters. We first bind the new queue to the same exchange, so new messages are copied to both queues. Then we start consumers on the new queue and stop them on the old one, but only after the old queue has drained to zero. If a service cannot tolerate both queues receiving copies for a while, we instead stop publishing to the old binding and let the old consumers finish its backlog. When the old queue is empty and unbound, we delete it. A Shovel, a RabbitMQ plugin that moves messages from one queue to another, can move a backlog that would take too long to drain.
5Test Before the Cluster Upgrade
In a test cluster on the target version, we stop the node holding a queue's leader while producers and consumers run, and check that publishers with confirms lose nothing and consumers continue after the new leader is elected. We reject messages to see them arrive in the dead-letter queue, let messages expire to check TTL dead-lettering, and push a queue past its length limit.
We also check that no queue still carries an ha-mode policy and that no service declares a mirrored queue, before the 4.0 upgrade. The upgrade notes for 4.0 list how the broker treats leftover mirroring policies, so we read them for our path. Moving the simplest services first, as pilots, gives each team a worked example before the critical queues move.
6Follow-up questions
Why not just change the policy to make the queue a quorum queue?
Because the queue type is fixed when a queue is declared. A policy can set many properties, but not the type, and redeclaring an existing queue with x-queue-type=quorum fails with PRECONDITION_FAILED. The only path is a new queue, which is why the plan moves traffic from old queues to new ones.
What happens to consumers that requeue failed messages forever?
On a quorum queue each redelivery is counted. Once the delivery limit is passed, 20 by default in 4.0, the message is dead-lettered if a dead-letter exchange is set, or dropped otherwise. That stops poison messages from looping forever, but services that relied on endless requeueing need a dead-letter queue and an alert before the move.
Do quorum queues cost more than classic queues?
They write every message to disk on a majority of replicas, so they use more disk and network, and very long queues use more memory for their index. For typical workloads the cost is acceptable for the safety.
7Conclusion
In this answer, we planned the move from classic mirrored queues to quorum queues before a RabbitMQ 4.0 upgrade. We built an inventory of queues, arguments, policies and owning services, checked the features that behave differently such as the delivery limit and dead-lettering strategy, created new quorum queues next to the old ones, changed each service's declarations, moved consumers once the old queues drained, and tested failover and dead-lettering in a test cluster before upgrading production.
Open with
Because RabbitMQ 4.0 removed classic mirroring, I would finish the move to quorum queues on the current version and only then upgrade. First I would build an inventory: every queue with its type, arguments and policy, the policies themselves, and which of the forty services declares each queue, because some settings like the dead-letter exchange live in code and some in policies.
Then, if they want more
Then I would check each feature against the quorum queue documentation for our version. The ones I expect to matter are the default delivery limit, which in 4.0 dead-letters a message after twenty redeliveries, the at-most-once default for dead-lettering, where I would choose at-least-once for critical queues, and features like exclusive or non-durable queues that stay classic.
Since a queue's type can't be changed in place, each queue gets a new quorum queue alongside it, bound to the same exchange. The service's declarations change to QueueBuilder with quorum, so a restart doesn't recreate the classic queue, consumers move over, and the old queue is deleted once it drains, with a Shovel if the backlog is large.
I'd start with a few simple services as pilots and give the teams a guide. Before the upgrade, I'd test in a cluster on the target version: kill the leader under load, reject and expire messages to check dead-lettering, and confirm no ha-mode policies remain.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- RabbitMQ documentation
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Your RabbitMQ estate still uses classic mirrored queues, and RabbitMQ 4.0 removed...": https://scrivio-interview-library.netlify.app/spring-boot/rabbitmq-and-jms/c949d30cf4/