Access Keys:
Skip to content (Access Key - 0)
Cancel    
Cancel   
 

Contents

Mule Examples

Mule provides a suite of example materials to help you learn more about building applications in Mule Studio and Mule Standalone. 

 Contents

Examples and Templates

Mule example applications offer insight into how you can use Mule to manage system connection and integration situations. Based on real-life business use cases, the examples demonstrate Mule's features and functionality, and suggest how you can take advantage of them.

  • In Mule Studio, Mule's graphical interface, these example apps exist in the form of templates which you can use to build a Mule application without having to start from scratch.
  • In Mule Standalone, (Mule without Studio) these example apps exist as files in the examples folder of the product distribution. You can access these example applications from your computer's console, using them as foundations upon which to build your own apps.

 

ComplexityExample AppKey ConceptsIncluded in Runtime
CommunityEnterprise

Low

Hello WorldInteracts with an end user via an HTTP request.

LowHTTP Request-Response with LoggerLogs activity in an application.

MediumConnect with SalesforceFacilitates communication between a file-based system(s) and Salesforce. 
MediumDataMapper with FlowRefLookup

Facilitates communication between a file-based system(s) and Salesforce.

Uses a FlowRefLookup Table to acquire information outside the message, then append it to the payload. 

 

MediumLegacy ModernizationActs as a Web service proxy for a legacy, file-based system. 

MediumForeach Processing and Choice Routing

Dynamically applies routing criteria to a message at runtime.

Processes collections iteratively without losing any of the payload.

Enriches message payloads with data, rather than changing payload contents.

MediumWebsphere MQFacilitates message processing between Mule and WMQ.  

HighXML-only SOAP Web Service

Orchestrates a sequence of calls to other services or message queues.

Dynamically applies routing criteria to a message at runtime.

 

HighSOAP Web Service SecurityImplements application-layer security on a SOAP Web service. 

HighService Orchestration and Choice Routing

Orchestrates a sequence of calls to other services or message queues.

Dynamically applies routing criteria to a message at runtime.

Processes collections iteratively without losing any of the payload.

Caches message content during processing to reuse frequently called data.

 

 

Create and Run Example Applications

    Create

    1. If you haven't already done so, visit www.mulesoft.org and download Mule ESB with Mule Studio for free. Follow the instructions on the website to launch Mule Studio and select a workspace.
    2. Click the File menu, then select New > Mule Project.
    3. Use the table below to enter values in the fields.


       

      FieldValue
      Namea name for your new project
      Descriptiona brief description of the application you intend to build
      Server RuntimeMule Server 3.4.0 EE

      How do I get Mule 3.4 Community runtime?

       

    4. Click the box next to Create project based on an existing template.
    5. Click a line item to select the template you wish to use to build your project. 
    6. Click Finish. Studio creates and opens the new project, complete with pre-built and pre-configured flows.

    Run

    1. In the Package Explorer pane in Studio, right-click the project name, then select Run As > Mule Application. Studio runs the application and Mule is up and kicking!

    2. To stop the application from running, click the red Terminate button in Studio's Console.

    Create

    1. If you haven't already done so, visit www.mulesoft.org and download Mule ESB standalone runtime (without Mule Studio) for free. (Alternatively, download a trial version of Mule ESB Enterprise (with Management Tools).
    2. Navigate to the folder on your local drive that contains your copy of Mule ESB Standalone runtime.
    3. Locate the Examples folder, then the folder for the example you wish to run.
    4. Copy the pre-built application archive (the .zip file) for the example.
    5. Paste the copy of the .zip file in the Mule applications folder, $MULE_HOME/apps.
      For example, to run the Hello World example, copy mule-example-hello-3.4.0.zip then move the copy to the $MULE_HOME/examples folder. 

      Alternatively, you can build the example in a build tool such as Ant or Maven.

      1. Run ant or mvn in your Ant or Maven build tool, respectively.
      2. The build tool compiles the example classes, produces an application zip file and copies it to your $MULE_HOME/apps folder.
    6. Start Mule.

       Need more detail?
      1. Open a new command line.
        Windows: Open the Console.
        Mac: Open the Terminal application (Applications > Utilities > Terminal).
      2. Access the directory and folder in which you pasted the zip file for your example (i.e. the application folder in Mule). For example, type cd /Users/aaron/Downloads/mule-standalone-3.4.0/
      3. To start Mule, type ./bin/mule
    7. After it starts, Mule polls the apps and examples folders every 5 seconds; it picks up the application you copied to the examples folder, then deploys it automatically. In the first command line, Mule notifies you that it has deployed the example application.
    8. To stop the application from running, hit CTRL-C.

     

    Go Further