Integrating Mule and RabbitMQ
RabbitMQ can be deployed in distributed environments to meet high-scale, high-availability requirements.
Join the DZone community and get the full member experience.
Join For FreeRabbitMQis one of the open source message brokers or queue manager software, which uses Advanced Message Queuing Protocol (AMQP). It implements a broker architecture, meaning that messages are queued on a central node called Exchange before being sent to clients. This approach makes RabbitMQ very easy to use and deploy. RabbitMQ can be deployed in distributed environments to meet high-scale, high-availability requirements.
The Message Flow in RabbitMQ
Objective
Integrating RabbitMQ with Mule and publishing an Employee Details onto a queue using RabbitMQ.
Prerequisites
- Mule Anypoint Studio.
- RabbitMQ server and server details.
To Integrate RabbitMQ with Mule, you need to have AMQP connector installed in Anypoint studio. So, first, download and install AMQP connector from the Anypoint exchange. Once the connector is installed, you can find all the endpoints and transformers related to AMQP in Mule Palette section.
Creating Mule Project to Publish Messages to RabbitMQ:
Configuring the AMQP Connector:
Note: Unlike ActiveMQ it will not create a queue if it is not present.
One should provide the name of the queue which is already present in the server queues.
I have already created a queue (Employee) in the server, so I am just providing the name here.
Here, you can find a list of the actions that can be performed on the queue. Expand Get messages.
Now you can see the message that had been published and other JMS properties.
Conclusion
Opinions expressed by DZone contributors are their own.
Comments