Use Shovel for Message Migration
Use RabbitMQ Shovel when you need to move messages between brokers, clusters, or virtual hosts. Shovel is well suited for queue-to-queue migration, temporary forwarding, or controlled replay into another environment.
Shovel is not a full-cluster synchronization mechanism. It does not synchronize users, permissions, virtual hosts, exchanges, queues, bindings, Kubernetes resources, or application configuration. Prepare those objects separately before you rely on Shovel for workload migration.
TOC
Applicable ScenariosPrerequisitesEnable the Shovel pluginsProcedure1. Choose the host cluster for the dynamic Shovel2. Create the dynamic Shovel3. Check the Shovel status4. Verify message movement5. Remove the Shovel when migration completesOperational NotesRelated InformationApplicable Scenarios
Use Shovel when you need one or more of the following:
- Migrate messages from one queue to another queue in a new cluster.
- Replay messages into a replacement environment during a controlled migration.
- Move backlog between sites during a planned cutover.
Use RabbitMQ Disaster Recovery with Federated Exchanges when you need exchange-based asynchronous replication instead of queue-to-queue transfer.
Prerequisites
Before you configure a Shovel, make sure that the following conditions are met:
- The cluster that hosts the Shovel has the
rabbitmq_shovelplugin enabled. - Enable
rabbitmq_shovel_managementwhen you want management UI or HTTP API visibility for dynamic Shovels. - Source and destination RabbitMQ endpoints are reachable from the cluster that hosts the Shovel.
- The source and destination users have the required permissions.
- Destination exchanges or queues already exist, or you have an explicit process to create them before the migration.
Enable the Shovel plugins
The following example enables the required plugins on the cluster that runs the Shovel:
Verify the enabled plugins:
Procedure
1. Choose the host cluster for the dynamic Shovel
Dynamic Shovels are stored as RabbitMQ runtime parameters. Create the Shovel on the cluster that has reliable network connectivity to both the source and destination brokers.
2. Create the dynamic Shovel
The following example moves messages from the orders queue on the source broker to the orders-migrated queue on the destination broker:
%2f is the URL-encoded default / virtual host. Replace it with the URL-encoded virtual host name that you actually use. If the user name or password contains reserved URI characters, URL-encode them as well.
Use ack-mode="on-confirm" for production migrations so the source side is acknowledged only after the destination confirms the publish.
3. Check the Shovel status
Verify that the Shovel is running:
You can also inspect runtime parameters:
4. Verify message movement
Check the source and destination queue depths:
5. Remove the Shovel when migration completes
If the Shovel is temporary, remove it after the migration:
Operational Notes
- Shovel moves messages, not full broker state.
- A destination queue that does not exist will cause the Shovel to fail unless the chosen destination exchange and routing behavior can create the intended path.
- Network interruptions cause reconnect attempts according to the configured reconnect delay.
- For long-running migration jobs, monitor queue growth, consumer lag, and broker alarms on both the source and destination sides.