TransWikia.com

Load RabbitMQ config at startup

Stack Overflow Asked by David Vasandani on November 18, 2021

How do I load a RabbitMQ config at startup to confirm that broker objects (queues, exchanges, bindings, users, virtual hosts, permissions and parameters) are created?

According to the RabbitMQ documentation, it can be done via load_definitions http://www.rabbitmq.com/management.html#load-definitions

But I can’t figure out how to use it. Would someone mind sharing an example of how this works? I can’t find any examples online.

One Answer

There's two bits that the documentation leaves to be desired that were stumbling blocks for me.

Generating the definitions file

I found the easiest way to do that is to configure one RabbitMQ server how you like it and then...

  1. Go to the management web interface
  2. Look at the bottom of the Overview tab/page for the "Import / export definitions" heading
  3. Click the "Download broker definitions" button in that section

Configuring RabbitMQ to look for a definitions file at startup

  1. Put the definitions file somewhere on the filesystem that it can be read by the user that your rabbitmq daemon will be running as.
  2. Include a block like this in the configuration file:

    {rabbitmq_management, [ {listener, [...]}, {load_definitions, "/etc/rabbitmq/definitions.json"} ]},

Upon startup, those definitions should get loaded. Any errors loading them should be apparent in the logs.

Answered by neilschelly on November 18, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP