Author: Saddam Shaikh
In this article, I will walk you through the process of setting up a message broker in Amazon MQ and build an application that connects Amazon MQ to receive queue messages.
What is Amazon MQ?
Amazon MQ is a managed message broker service for Apache ActiveMQ and RabbitMQ that streamlines the setup, operation, and management of message brokers on AWS. It is recommended for migrating applications from existing message brokers that rely on compatibility with APIs such as JMS or protocols such as AMQP, MQTT, OpenWire, and STOMP.
Amazon MQ Configuration Steps:
- Search Amazon MQ in AWS Console. Click on Get Started.
2. Select Apache ActiveMQ as the broker engine type and click on Next.
3. Select Deployment mode as Active/standby broker and Storage type as Durability optimized. Click on Next.
4. Enter the Broker name, Username, and Password. Keep Additional settings as the default one. Click on Next.
5. Review the details and click on Create Broker. It will take around 25 minutes to deploy the Amazon MQ message broker.
6. Once the Amazon MQ message broker status is showing Running, try to access the ActiveMQ Web Console URL. Only one of the ActiveMQ consoles is active at a time. If you are not able to access it then add your source IP in Inbound Rule to allow traffic.
7. Once the source IP is allowed to access ActiveMQ URL then you will see the ActiveMQ web console page.
Click on Manage ActiveMQ broker, pop up will appear to enter username & password, once successfully authenticated below page will be shown.
8. Click on Queues. Enter the Queue Name as “MuleSoft-1” and click on Create.
Click on Send To to open a window allowing us to send messages to the queue. Add the message body and click on Send.
9. Verify message is delivered to the queue.
MuleSoft Configuration Steps:
- Navigate to Add Modules and Drag and Drop the JMS connector to the Mule Palette section.
- Configure JMS config. Broker URL: OpenWire failover endpoint.
3. Configure the On New Message operation to receive messages from the queue.
4. Deploy the application and test.
Hope you find this article helpful.