0

Is it possible to declare exchanges when RabbitMQ is first installed/launched ?

I needed to explicitly declare some durable exchanges that consumers could bind to before any producer produces anything to them.

Can it be done with rabbitmq.config or other automatic measure?

Thanks

Matteo
  • 37,680
  • 11
  • 100
  • 115
noidraug
  • 219
  • 1
  • 9

1 Answers1

0

Yes, this is possible with management plugin. Read the Load definitions at startup.

In short: just put load_definitions variable set to path to previously exported JSON file containing the definitions you want, something like {load_definitions, "/path/to/json.file"}.

Note:

that the definitions in the file will overwrite anything already in the broker; using this option will not delete anything that is already there. However, if you start from a completely reset broker, use of this option will prevent the usual default user / virtual host / permissions from being created.

pinepain
  • 12,453
  • 3
  • 60
  • 65