Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Load RabbitMQ config at startup

Tags:

rabbitmq

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.

like image 768
David Vasandani Avatar asked Jan 28 '14 18:01

David Vasandani


People also ask

How do I access RabbitMQ config file?

%APPDATA%\RabbitMQ\rabbitmq.0+, the main configuration file is rabbitmq. conf . An additional config file named advanced. config is also used for some advanced configuration settings; it uses the classic format.

How do I access RabbitMQ locally?

local, it can be accessed by users with sufficient privileges at either http://warp10.local:15672/ or http://localhost:15672/ (provided that localhost resolves correctly).

What is RabbitMQ config?

DESCRIPTION. rabbitmq-env. conf contains environment variables that override the defaults built in to the RabbitMQ scripts and CLI tools. The file is interpreted by the system shell, and so should consist of a sequence of shell environment variable definitions.


1 Answers

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.

like image 81
neilschelly Avatar answered Oct 14 '22 19:10

neilschelly