Class Definitions

java.lang.Object
org.acemq.rabbitmq.admin.Definitions

public final class Definitions extends Object
Everything the broker is configured to be, as one document.

 Definitions backup = admin.exportDefinitions();
 Files.writeString(Path.of("broker.json"), backup.json());

 // ... on the new broker
 newAdmin.importDefinitions(Files.readString(Path.of("broker.json")));
 

Why this beats walking the topology

Queues, exchanges and bindings are the obvious things to export, and they are not all of it. Federation upstreams and shovels are runtime parameters, policies are separate again, and users, permissions and topic permissions are separate from all of those. A backup assembled by walking the topology misses every one of them, and the broker restored from it comes back looking complete while federating nothing.

This endpoint is the whole thing in one request, which is both a better backup and a cheaper one.

What it does not contain

No messages. This is configuration. Restoring definitions onto an empty broker gives you every queue, correctly configured, and every one of them empty.

Passwords are present but hashed. Users come back with password_hash, which is enough to restore them onto another broker and not enough to read anybody's password. It is still a credential: an exported definitions file lets anyone holding it stand up a broker that accepts your users' passwords. Treat the file as a secret.

  • Method Details