Load RabbitMQ config at startup

后端 未结 1 2291
谎友^
谎友^ 2021-02-20 13:46

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?

Acc

1条回答
  •  灰色年华
    2021-02-20 14:35

    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.

    0 讨论(0)
提交回复
热议问题