This script aims to manage the RabbitMQ server configuration.
To learn how use this script, please check the following examples. Before moving to the following examples, please make sure the rabbitmq is running.
## in case of the docker,
$ sudo docker pull rabbitmq:3.8.9-management
$ sudo docker run -it -d --rm --name rabbitmq --hostname rabbitmq -p 8983:8983 rabbitmq:3.8.9-management
If you would like to use the RabbitMQ server with your "webapp" application, we assume the followings;
- Your application uses the "webapp" user connecting to the RabbitMQ server.
- Your application uses the "/webapp" virtual host only, which means all of your queues and exchanges are defined under this virutal host.
- Your application uses some queues with a name like webapp.xxxx.
- All queues use the same dead letter exchange with a name like webapp.dlx.
- All queues use the same exchange with a name like webapp.
- The routing key of exchanges has the same name as the corresponding queue.
{
"appname":"app01",
"password":"secret",
"node":"rabbit@rabbitmq",
"queues":["queue01", "queue02"]
}
After cloning this repository, please setup the essential libraries.
$ make setup
Then, create your config.json file and call the script.
$ ./setup-rabbitmq-queues.rb setup config.json
If you want to delete the configuration, plase use the delete method.
$ ./setup-rabbitmq-queues.rb delete config.json