Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Mule 4: Hello World

DZone's Guide to

Mule 4: Hello World

Let's take a look at a tutorial for beginners on Hello World in Mule. Also look at images and explanations for each step.

· Integration Zone ·
Free Resource

The new Gartner Critical Capabilities report explains how APIs and microservices enable digital leaders to deliver better B2B, open banking and mobile projects.

Introduction

Many people are interested in learning Mule programming by themselves. When we are ready to start, it's always better to understand the basics and feel comfortable with the Anypoint Studio IDE and build and run the program with the basic components. Perhaps many of you have written hello world programs. Still, I believe giving basic details is always helpful to the MuleSoft community. I hope beginners will find this useful.

1. Create a new project as shown in the below screenshot. Right click on the left pane of Project Explorer and click on the MuleProject.

Image title

2. After clicking on the MuleProject, the below screen will be shown. Please make sure all the red circled sections are filled up.

Image title

3. Next, go through the folders created in the left pane. src/main/mule, src/main/java, src/main/resources,  src/test/java, src/test/munit, /src/test/resources,  and other folders are added to the project. 

Click on the helloworld1.xml file. on the right-hand side. You will notice a Mule Palette in which you will be able to view the components provided by MuleSoft.

Image title

4. Drag and drop the Listener component, Set Payload components. After that, click on the "+" icon in "Listener"  properties.

HelloWorld

5. Next, fill up the Host and Port fields as shown in the below screen.

Image title

6. Next, click on "Set Payload." After that, you can view the properties section as mentioned in the below screen. Fill up the details as shown:

Image title

7. Right click on the project window and run the project.

Image title

8. Verify the XML equivalent code of the project.

Image title

9. Run the localhost:8087 in the browser.

Image title


Conclusion

As it is a basic hello world program, you can start modifying the content of the Set Payload component and run the program once again. 

The new Gartner Critical Capabilities for Full Lifecycle API Management report shows how CA Technologies helps digital leaders with their B2B, open banking, and mobile initiatives. Get your copy from CA Technologies.

Topics:
mulesoft ,integration ,hello world ,tutorial

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}