Manage RabbitMQ Definitions
RabbitMQ definitions describe broker configuration such as virtual hosts, users, permissions, exchanges, queues, bindings, policies, runtime parameters, and operator policies. Use definitions to review, promote, or seed topology and security configuration across environments.
Definitions management is not a full backup and restore mechanism. Definitions do not contain queue contents, durable message stores, stream data, Kubernetes resources, TLS private keys stored outside RabbitMQ, or application configuration.
TOC
Applicable ScenariosChoose the Export ScopeExport DefinitionsCluster-wide exportSingle-vhost exportReview Definitions Before ImportImport DefinitionsVerify Imported DefinitionsRelated InformationApplicable Scenarios
Use definitions management when you need to:
- Move reviewed topology and access-control definitions between environments.
- Seed a disaster recovery cluster with the same virtual hosts, users, permissions, exchanges, queues, bindings, policies, and runtime parameters.
- Store sanitized RabbitMQ topology as an auditable configuration artifact.
- Compare the current broker topology with the expected topology.
Do not use definitions export and import as a way to recover queued messages.
Choose the Export Scope
Definitions export can be cluster-wide or virtual-host scoped:
The exact keys in the exported file depend on the RabbitMQ version and export scope. Always inspect the generated JSON before importing it.
Export Definitions
Cluster-wide export
Run a cluster-wide export when you need both topology and access-control definitions:
You can also export from a RabbitMQ Pod:
Copy the file from the Pod only if your operational process requires a local copy:
Single-vhost export
Use a single-vhost export when the target virtual host, users, and permissions are already managed separately:
In RabbitMQ 3.8.16, a vhost-scoped export contains topology keys such as exchanges, queues, bindings, parameters, and policies, but it does not include users, permissions, or virtual host records. Verify the output in your environment before relying on the file.
Review Definitions Before Import
Before importing definitions into another cluster, review the file for:
- Site-specific upstream URIs, Shovel parameters, Federation parameters, or policies.
- Users or permissions that should not exist in the target environment.
- Queue arguments that should differ between environments, such as message TTL or queue length limits.
- Runtime parameters that reference primary-site hostnames.
- Password hashes and other sensitive values that must be protected.
Store reviewed files in a controlled location. If you commit definitions to Git, remove environment-specific values and secrets first.
Import Definitions
Import the reviewed file into the target RabbitMQ cluster:
If the file was exported for a single virtual host, include the same target virtual host on import:
When importing from inside a Pod, place the file in the Pod first and run:
Verify Imported Definitions
Verify topology:
If you imported cluster-wide definitions, also verify access-control objects: