DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workkloads.

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • MDC Logging With MuleSoft Runtime 4.4
  • MuleSoft APIkit Router - QueryParam and Header Strict Validation Configuration
  • How to Use Mulesoft VM Connector
  • Deep Dive Into JMS Integration Patterns With MuleSoft and JMS Behavior With Anypoint Clustering and Server Groups

Trending

  • Microsoft Azure Synapse Analytics: Scaling Hurdles and Limitations
  • Beyond ChatGPT, AI Reasoning 2.0: Engineering AI Models With Human-Like Reasoning
  • Unlocking the Potential of Apache Iceberg: A Comprehensive Analysis
  • Create Your Own AI-Powered Virtual Tutor: An Easy Tutorial
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. MuleSoft Integration With RabbitMQ

MuleSoft Integration With RabbitMQ

MuleSoft integration with RabbitMQ to consume messages from a queue.

By 
Muhammad Noman user avatar
Muhammad Noman
·
May. 26, 21 · Tutorial
Likes (4)
Comment
Save
Tweet
Share
17.9K Views

Join the DZone community and get the full member experience.

Join For Free

This article will explain in detail, how to integrate with RabbitMQ in MuleSoft and read messages from a queue.

Install and Setup RabbitMQ on Mac

In this section, I will explain how to install RabbitMQ on Mac, create a new queue and publish messages to the queue using the RabbitMQ portal.

Step 1: Install RabbitMQ.

brew install rabbitmq

Step 2: Start RabbitMQ Server.

Start RabbitMQ server in the foreground using the below command:

rabbitmq-server

Or start the server in the background using the below command:

brew services start rabbitmq

Step 3: Access RabbitMQ.

http://localhost:15672/

Access RabbitMQ

Enter both username and password as guest.

Step 4: Create New Queue.

http://localhost:15672/#/queues

Step 5: Publish Message in Queue.

http://localhost:15672/#/queues/%2F/order

Publish Message in Queue

Setup Mule Application 

In this section, I will explain how to create a new Mule application, listen on RabbitMQ queue, read a message from the queue.

Step 1: Create a new Mule 4 application:

Open Anypoint Studio click on File -> New -> Application Name (app-rabbitmq-orders).

Step 2: Install AMQP connector from the exchange:Install AMQP Connector From Exchange

Step 3: Create flow to read the message from order queue:Create Flow to Read Message

XML
 




xxxxxxxxxx
1
14


 
1
<?xml version="1.0" encoding="UTF-8"?>
2

          
3
<mule xmlns:amqp="http://www.mulesoft.org/schema/mule/amqp" xmlns="http://www.mulesoft.org/schema/mule/core"
4
    xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
5
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
6
http://www.mulesoft.org/schema/mule/amqp http://www.mulesoft.org/schema/mule/amqp/current/mule-amqp.xsd">
7
    <amqp:config name="AMQP_Config" doc:name="AMQP Config" doc:id="de2abf40-5ad2-4942-a874-99d12c486b4b" >
8
        <amqp:connection host="localhost" username="guest" password="guest" />
9
    </amqp:config>
10
    <flow name="app-rabbitmq-ordersFlow1" doc:id="aa37df28-a708-4d2d-8ee1-ee8ca0c4dfd0" >
11
        <amqp:listener doc:name="OrderQueueListener" doc:id="88ebbb66-8592-44f2-aee0-2d39ddb66d63" config-ref="AMQP_Config" queueName="order" ackMode="IMMEDIATE"/>
12
        <logger level="INFO" doc:name="RqbbitMQ Message" doc:id="4b2c8676-8baf-4ba2-adee-e28f0f1edc06" message="#[payload]"/>
13
    </flow>
14
</mule>


Step 4: Test the MuleSoft Application ListenerTest MuleSoft Application Listener


MuleSoft Integration application Command (computing) Connector (mathematics) Testing XML Flow (web browser)

Opinions expressed by DZone contributors are their own.

Related

  • MDC Logging With MuleSoft Runtime 4.4
  • MuleSoft APIkit Router - QueryParam and Header Strict Validation Configuration
  • How to Use Mulesoft VM Connector
  • Deep Dive Into JMS Integration Patterns With MuleSoft and JMS Behavior With Anypoint Clustering and Server Groups

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!