- Install RabbitMQ
- Step 1: Install Erlang
- Step 2: Install RabbitMQ
- Enable RabbitMQ Web Console
- RabbitMQ Login Page
- RabbitMQ Overview Page
- Start RabbitMQ Service in Windows
- Setting up Mule
- Create New Mule App and Design Flow
- Add AMQP-0-9 Connector Global Element
- Create A Queue in RabbitMQ
- Create A Virtual Host in RabbitMQ
- Test RabbitMQ From Mule
- Publish a message in RabbitMQ
- Test the mule-3.9 app
- RabbitMQ Test Project in Mule-3.9
Install RabbitMQ
Here is the quick installation guideline for Ubuntu 18.04
Step 1: Install Erlang
RabbitMQ needs Erlang to run. To install the latest version of Erlang, add the repository below
sudo sh -c 'echo "deb https://packages.erlang-solutions.com/ubuntu $(lsb_release -sc) contrib" >> /etc/apt/sources.list.d/erlang.list' |
wget https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc sudo apt-key add erlang_solutions.asc |
sudo apt update sudo apt install erlang |
Step 2: Install RabbitMQ
Add RabbitMQ Repository, Add Repository Key, Install RabbitMQ and Enable on Startup.
sudo sh -c 'echo "deb https://dl.bintray.com/rabbitmq/debian $(lsb_release -sc) main" >> /etc/apt/sources.list.d/rabbitmq.list' |
wget -O- https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc | sudo apt-key add - wget -O- https://www.rabbitmq.com/rabbitmq-release-signing-key.asc | sudo apt-key add - |
sudo apt update sudo apt install rabbitmq-server |
sudo systemctl enable rabbitmq-server sudo systemctl start rabbitmq-server |
For other Operating Systems please see the links below:
Enable RabbitMQ Web Console
RabbitMQ provides a web console to manage it easily. To enable the console, run the commands below
sudo rabbitmq-plugins enable rabbitmq_management |
After that, open your browser and browse to the server name or IP address followed by port # 15672
Example: http://localhost:15672
You should see RabbitMQ web management console to logon. The default username and password is guest.
Username: guest
Password: guest
RabbitMQ Login Page
RabbitMQ Overview Page
Start RabbitMQ Service in Windows
In windows system the RabbitMQ Service starts automatically. If not then you need to start it manually after installation
as like the image below. Then enable RabbitMQ Management console as shown in the following CLI.
Setting up Mule
Now open AnypointStudio and enter the AnyPointStudio Exchange Login Page.
Login and install AMQP connector mule component.
Create New Mule App and Design Flow
Now create a new Mule project and add the following components to Mule flow:
Add AMQP-0-9 Connector Global Element
Add a AMQP-0-9 Connector Global Element to the mule flow with following properties
Create A Queue in RabbitMQ
Logon to RabbitMQ Web-console with guest user and create a queue with name "queue"
Create A Virtual Host in RabbitMQ
Create a vhost with name "/test"
Set up logger log message and run the project.
Test RabbitMQ From Mule
Publish a message in RabbitMQ
Now publish a message in the queue named queue
Test the mule-3.9 app
Check mule console log to check the output
RabbitMQ Test Project in Mule-3.9
For your convenience the sample mule-3.9 project has been attached below
RabbitMQ Test App using Mule-3.9 |
---|
No comments:
Post a Comment