Rabbit MQ Broker AWS Setup
This is a step-by-step guide on how to set up a RabbitMQ broker in the Amazon MQ service.
However, you can also choose to set up and manage the RabbitMQ broker on your own server.
Detailed information about the Amazon MQ service can be found in the official AWS documentation.
The configuration of a RabbitMQ broker consists of 2 steps:
Broker creation
Broker configuration
Broker creation
Find service “Amazon MQ” using the search panel
Click on the “Get started” button
Select “Rabbit MQ” engine and click “Next”
For simplicity choose the single-instance broker. If you wish to set up a more reliable cluster deployment please refer to the official documentation.
Configure the settings.
Brocker name | guide-broker | broker identifier in the Amazon MQ service |
Brocker instance type | mq.t3.micro | You can select the smallest instance for now Larger instances will be required for over 100,000 devices |
Username | guide_user |
|
Password | <your password> |
|
Please save your username and password as it will be required for broker configuration and integration.
Fill out the form and click ”Next”:
You can review your broker configuration on the last screen. Click “Create broker” to finalize the creation procedure.
Now you see the list of brokers. Wait until the new broker status will change to “Running“.
The broker creation is complete. Now you can proceed to the next step.
Broker configuration
The broker configuration step explains how to configure RabbitMQ Queue, RabbitMQ Exchange and bind the queue to the exchange.
Go to Amazon MQ → Brockers page
Click on the broker name which was created in the previous step.
In the Connections section, you can find the Endpoint URL. You will need this URL to configure the integration Nwave.
Click on the “RabbitMQ web console” link to continue broker configuration
In the newly opened tab, you must enter the username and password used during broker creation in the previous step
Now you have to register a new Virtual Host. Go to “Admin Page”, select “Virtual Hosts” menu on the right and click on expanding form “Add a new virtual host”
Give a name to your new virtual host and click on the “Add virtual host” button.
Now you can see the create virtual host in the table
Now you have to create a new exchange. Go to the “Exchanges” menu and click on the expanding form “Add a new exchange”
Fill the exchange creating form. You should select the virtual host created in the previous step and give a new name to the exchange. The exchange name is needed for integration with Nwave Cloud. Fill all other options as on the screenshot:
Click on the button “Add exchange” to finish the exchange registration.
Now you have to create a new Queue. Go to the menu “Queues” and click on expanding form “Add a new queue”
Fill the form. You should select previously create Virtual Host and give a name to your queue. Remember the queue name. It is needed for Nwave Cloud integration.
Click on the button “Add queue” to finish.
Now click on the Queue name in the table
Open the form “Bindings”
Fill in the previously registered exchange name and queue name
Finally, press the button “Bind”.
Integration credentials
Here is the list of all credentials than you need to proceed integration with Nwave Cloud:
Broker URL
Username
Password
Virtual Host
Exchange name
Queue name
Now you can proceed to the integration with Nwave Cloud.
Integration with Nwave Cloud
Go to the main menu
Go to the RabbitMQ → Endpoints page
Click on the button at the bottom right
Fill out the “New endpoint” form:
Name - user-defined
Host - the endpoint URL excluding “amqps://” prefix and excluding the “:port“ postfix
Port - 5671
VHost - your virtual hostname
Exchange - your exchange name
Exchange is durable - yes, because this option was selected during the exchange registration
Exchange type - Direct, because this option was selected during the exchange registration
Queue - your queue name
Login - your broker’s username
Password/Repeat password - your broker’s password
Click on the “Add” button.
Now you should see the created Endpoint in the Endpoints table:
Go to the Routes menu to continue the integration
Click on the button in the bottom right
Fill the form. Select Zone for sending data to RabbitMQ, your previously created Endpoint and message type. Toggle Active option if you want to start sending data after the route is created:
Press the button “Add” to finish the route registration.
Integration testing
To test the integration you should wait until your sensor sends at least one message. The sensor should be positioned in the zone, which was selected during the route registration. All messages sent to your RabbitMQ broker are displayed on the RabbitMQ → History page:
Also, you can check if your RabbitMQ broker is receiving messages. Go to the RabbitMQ broker administration page, find your queue on the Queues page and click on the name of your queue. You should see message processing statistics: