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
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Key Takeaways From Integrating a RAG Application With LangSmith
  • Improving Java Application Reliability with Dynatrace AI Engine
  • Enabling Single-Sign-On in SaaS Application
  • Reimagining Innovation: How Citizen Application Development is Reshaping the Modern Enterprise

Trending

  • Why Your DLP Policies Fall Short the Moment AI Agents Enter the Picture
  • Building a DevOps-Ready Internal Developer Platform: A Hands-On Guide to Golden Paths, Self-Service, and Automated Delivery Pipelines
  • Master-Class: Understanding Database Replication (Single, Multi, and Leaderless)
  • Comparing Top Gen AI Frameworks for Java in 2026
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. Creating a Mule ESB Sample Hello World Application

Creating a Mule ESB Sample Hello World Application

Mule is a lightweight, open source integration framework. In this tutorial, learn the requirements and steps for creating a sample Mule application.

By 
Naseer Shaik user avatar
Naseer Shaik
·
Updated Jan. 14, 21 · Tutorial
Likes (14)
Comment
Save
Tweet
Share
91.0K Views

Join the DZone community and get the full member experience.

Join For Free

Mule ESB is an integration technology that can connect different applications. Mule is an open-source integration framework consisting of different Connectors that can easily integrate our applications.

Mule is a lightweight integration framework. Mule ESB includes powerful capabilities including REST, SOAP, JMS, Salesforce, Cloudhub, RAML, Http, Datasource, Dataweave, Java, and MongoDB.

MuleSoft Anypoint Studio is a user-friendly IDE where we can easily drag Connectors from the Mule Palette.

In this article, I am going to show you how to create a Mule ESB Sample Application. For this, we need the below requirements.

1. Java 8 (JDK 1.8)

2. Anypoint Studio

3. Postman

Mule ESB Sample Application

XML
 




x
15


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

          
3
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
4
xmlns:spring="http://www.springframework.org/schema/beans" 
5
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
7
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
8
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd">
9

          
10
  <http:listener-config name="HTTP_Listener_Configuration1" host="0.0.0.0" port="8081" basePath="/sample" doc:name="HTTP Listener Configuration"/>
11
    <flow name="sample-appFlow">
12
        <http:listener config-ref="HTTP_Listener_Configuration1" path="/{parmname}" allowedMethods="GET" doc:name="HTTP"/>
13
        <set-payload value="#[message.inboundProperties.'http.uri.params'.parmname]" doc:name="Set Payload"/>
14
    </flow>
15
</mule>



Follow the below steps or copy the above code into Mule Configuration XML (src/main/app/sample-app.xml).

Step 1: Open Anypoint Studio and Create a new project using File->New ->Mule Project.

To create New Project

Step 2: Type a Project Name like "sample-app" and press the Finish button.

Project Name

Step 3: Drag an HTTP Connector from Mule Palette.

Drag Http Connector from mule palette

Step 4: Click on the HTTP Connector and you can find HTTP Attributes in the below screen. We need to configure some details of the HTTP Connector.

Set Http Configure details

Step 5: Configure port "8081" and the Base path as "/sample" & press the OK button.

Http Configure Details

Step 6: Set the path as "/{paramname}" and Allowed Methods to "GET."

Http Configure Details

Step 7: Drag a Set Payload from Mule Palette.

SetPayload Connector

Step 8: Click on Set Payload and set the value.  #[message.inboundProperties.'http.uri.params'.parmname] 

SetPayload

Step 9: To run this application, right click on Mule Flow and select "Run Project sample-app."

How to run project

Step 10: You can see some logs in the console screen; the status is showing that the application was deployed.

Status Deployed

Step 11: Go to Postman:

                Select Method: "GET"

                URL: http://localhost:8081/sample/

                Param value: Helloworld

                Example: http://localhost:8081/sample/Helloworld

PostmanStep 12: To stop the application, go to Mule Flow, right click and select "Stop Project sample-app."

How to stop application

Enterprise service bus application

Opinions expressed by DZone contributors are their own.

Related

  • Key Takeaways From Integrating a RAG Application With LangSmith
  • Improving Java Application Reliability with Dynatrace AI Engine
  • Enabling Single-Sign-On in SaaS Application
  • Reimagining Innovation: How Citizen Application Development is Reshaping the Modern Enterprise

Partner Resources

×

Comments

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

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

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 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook