Migration from classic queues to quorum queues

280 views
Skip to first unread message

Vishnu Vardhan

unread,
Jan 3, 2025, 12:17:58 AM1/3/25
to rabbitmq-users
Hi team,

From rabbitmq version 4.0 in which mirroring of classic queues is removed, what is the approach to migrate to quorum queues if replication of queues is required.

There is a documentation for migration - https://www.rabbitmq.com/docs/3.13/migrate-mcq-to-qq, but it says "This is documentation for RabbitMQ 3.13, which is no longer actively maintained." Couldn't find the latest documentation.

I have come across this - https://groups.google.com/g/rabbitmq-users/c/shi9ISJYsRU , in which the response is to create quorum queues, sync classic queues data into quorum queues and use these new quorum queues to replicate data

Please clarify on these
1. How to migrate from classic queues to quorum queues to allow replications of queues
2. Once we have quorum queues in-place is there a similar rabbimtqctl command ( {"ha-mode":"all","ha-sync-mode":"automatic"} ) to replicate quorum queues

Michal Kuratczyk

unread,
Jan 3, 2025, 3:38:42 AM1/3/25
to rabbitm...@googlegroups.com
This documentation still applies. It's not in the 4.0 docs, because mirroring doesn't exist in 4.0 so there's no "mirrored classic queues to quorum queues migration" in the 4.0 context as such.
Such a migration should generally be performed before upgrading to 4.0, but can be done after the upgrade as well, if you accept that the queues won't be replicated
temporarily (from when you upgraded to 4.0 until you migrated them from classic. no longer mirrored, to quorum queues).

Quorum queues are replicated by default - you don't need any policies to enable replication of quorum queues.

Best,

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/rabbitmq-users/13417dff-b031-4ea2-91bb-ccc0f9da016fn%40googlegroups.com.


--
Michal
RabbitMQ Team

This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.

Vishnu Vardhan

unread,
Jan 6, 2025, 5:53:32 AM1/6/25
to rabbitmq-users
Hi, thanks for the reply

I went through the above migration documentation and I have few queries:
1. As a prerequisite to migration it is mentioned that few strings needs to be removed from the source code, does that mean to do this migration activity we need to have rabbitmq source code and building rabbitmq rpm from source code in-place ?
2. If I have a rabbitmq instance with only classic queues created and not mirrored (i.e no mirrored classic queues), now to have queue replication , do I have to follow the same documentation.


Michal Kuratczyk

unread,
Jan 7, 2025, 4:00:27 AM1/7/25
to rabbitm...@googlegroups.com
> 1. As a prerequisite to migration it is mentioned that few strings needs to be removed from the source code, does that mean to do this migration activity we need to have rabbitmq source code and building rabbitmq rpm from source code in-place ?

No, of course not. This refers to your application's code. If the application declares queues with certain arguments for example, they may need to be removed/adjusted.
Ideally, you should also add the argument to make the queue a quorum queue (x-queue-type=quorum) to your application's source, so that quorum queues are explicitly requested.
Alternatively, you may define the default queue type for a vhost to be quorum and this way a queue that is declared without specifying a type, will be declared as a quorum queue
(by default, a queue declared without an explicit type is a classic queue).

> 2. If I have a rabbitmq instance with only classic queues created and not mirrored (i.e no mirrored classic queues), now to have queue replication , do I have to follow the same documentation.

Pretty much. In this case, you don't have a policy for classic queue mirroring so you have a bit less work to do, but you still need to declare the queues to be quorum, either by explicitly
requesting that in your application (or whatever method you use for declaring queues) or by changing the default queue type. It pretty much all boils down to the fact that the queue type
can't be changed (using a policy or anything else) after the queue is declared. Therefore, you need to declare it as a quorum queue (if you already have a classic queue with the name you
want to use, it needs to be deleted first, perhaps with the messages consumed/moved if there are any that you care about). So you can follow steps like

(assuming no messages that need to be preserved):
1. delete a classic queue abcde
2. declare a quorum queue abcde

(assuming you want to maintain the messages):
1. declare a temporary queue
2. shovel messages from classic queue abcde to the temporary queue
3. delete the classic queue abcde
4. declare a quorum queue abcde
5. move messages from the temporary queue to the quorum queue abcde
6. delete the temporary queue

There are other options but hopefully this gives you enough to understand the task.


Vishnu Vardhan

unread,
Feb 4, 2025, 4:52:02 AM2/4/25
to rabbitmq-users
Hi, I was trying out this in-place migration procedure https://www.rabbitmq.com/docs/3.13/migrate-mcq-to-qq#migrate-in-place
I have observed upgrade failure from 3.13.3 to 4.0.3 when ha-policy is enabled, when I delete the policy and then perform the upgrade it works fine
But the in-place migration steps doesn't talk about deleting this ha-policy, only these incompatible features are listed - https://www.rabbitmq.com/docs/3.13/migrate-mcq-to-qq#mcq-changes-way-queue-is-used,  https://www.rabbitmq.com/docs/3.13/migrate-mcq-to-qq#mcq-features-to-remove

Michal Kuratczyk

unread,
Feb 4, 2025, 5:02:49 AM2/4/25
to rabbitm...@googlegroups.com

Vishnu Vardhan

unread,
Feb 4, 2025, 5:17:11 AM2/4/25
to rabbitmq-users
Attached the log file
migration_logs
Reply all
Reply to author
Forward
0 new messages