Wednesday, 30 January 2013

Getting Started with Mule ESB


Introduction
 Mule ESB is a light weight java based framework and integration platform that allows developers to connect applications together quickly and easily, enabling them to exchange data. Mule ESB enables easy integration of existing systems,
Prerequisite
Start with Development
First create a new mule project File->Mule Project
 
Right click on src/main/java->New->Class






 Once the "New Java Class" window opens, first enter name “com.org” in the “package” filed and enter name "Greeting" in the "Name" field and click on "Finish" button.


Write the below code in "Greeting.Java"
package com.org;

public class Greeting {
     
      public String sayHi(String str)
      {
            return "How are you "+str;
           
      }

}

Now from the EndPoints pallete, choose Http Endpoint and change Port to 7777.Next from the Components pallete, choose "Java" component, From the pallete we drag two component, one from HTTP Endpoint and another form Java Component, Just Drag and Drop on the Flow canvas.
 


Configure the Java Component
Double click on the "Java Component" and from the properties window that appears, enter "com.oeg.Greeting" in the "Class Name". Click "OK" once done.
Deploy the application
Now we ready to start the deployment, right click on “hellomule.mflow” choose Run As->Mule Application.



open up the browser, and type "http://localhost:7777/Mule".Press Enter.
The output in the browser is as under

References

0 comments:

Post a Comment