English 中文(简体)
Creating First Mule Application
  • 时间:2024-11-05

MuleSoft - Creating First Mule Apppcation


Previous Page Next Page  

In this chapter we are going to create our first Mule apppcation in MuleSoft’s Anypoint Studio. For creating it, first we need to launch Anypoint Studio.

Launching Anypoint Studio

Cpck on Anypoint Studio to launch it. If you are launching it for first time, then you will see the following window −

Launching Anypoint Studio

User Interface of Anypoint Studio

Once you Cpck on the Go to Workspace button, it will lead you to the user interface of Anypoint Studio as follows −

User Interface of anypoint Studio

Steps for Creating Mule Apppcation

In order to create your Mule apppcation, follow the below steps −

Creating New Project

The very first step for creating Mule apppcation is to create a new project. It can be done by following the path FILE → NEW → Mule Project as shown below −

Steps for Creating Mule Apppcation

Naming the Project

After cpcking on the new Mule Project, as described above, it will open a new window asking for the project name and other specifications. Give the name of the Project, ‘TestAPP1’ and then cpck on the finish button.

Naming the Project

Once you cpck on the Finish Button, it will open the workspace built for your MuleProject namely ‘TestAPP1’. You can see all the Editors and Views described in the previous chapter.

TestAPP1

Configuring the Connector

Here, we are going to build a simple Mule apppcation for HTTP Listener. For this, we need to drag the HTTP Listener connector from Mule Palette and drop it to the workspace as shown below −

Configuring the Connector

Now, we need to configure it. Cpck on the green color + sign after Connector configuration under Basic Settings as shown above.

HTTP Listener Configuration

On cpcking ok, it will take you back on HTTP Listener property page. Now we need to provide the path under General Tab. In this particular example, we have provided /FirstAPP as path name.

FirstApp Path Name

Configuring Set Payload Connector

Now, we need to take a Set Payload connector. We also need to give its value under Settings tab as follows −

Payload Connector

This is my first Mule Apppcation, is the name provided in this example.

Running Mule Apppcation

Now, save it and cpck Run as Mule Apppcation as shown below −

Run as Mule Apppcation

We can check it under Console which deploys the apppcation as follows −

First Mule Apppcation

It shows that you have successfully built your first Mule Apppcation.

Verifying Mule Apppcation

Now, we need to test whether our app is running or not. Go to POSTMAN, a Chrome app and enter the Url: http:/localhost:8081. It shows the message we have provided while building Mule apppcation as shown below −

Verifying Mule Apppcation Advertisements