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

Mule Examples

Dec 05, 2013 11:21

Robin Pille

Jan 14, 2014 16:54

Mulesoft Current Mule Documentation

Mule Examples

Mulesoft Documentation Page

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. 
    MediumAnypoint DataMapper 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.

     

     

     

    The examples included with Mule Standalone persist from Mule 3.3.X. Therefore, the documentation for these examples resides within Mule 33X Documentation.

    ComplexityExample AppKey ConceptsIncluded in Runtime
    CommunityEnterprise

    Low

    helloInteracts with an end user via an HTTP request.

    LowechoLogs activity in an application.
    LowgpswalkerUses AJAX to communicate from a Mule to a Web browser.
    Lowloanbroker-simple

    Uses the simple-service configuration pattern, transformers and filters with Groovy scripting, and CXF clients and services.

    Lowscripting

    Invokes a JSR-223 script from Mule.

     Dynamically applies routing criteria to a message at runtime.

    Uses JVM environment variables.

    MediumforeachProcesses collections iteratively without losing any of the payload.
    Mediumbookstore  Exposes a Web service using Jetty and CXF.
    Mediumstockquote

    Invokes an ASPX Web service from Mule.

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

    MediumwmqFacilitates message processing between Mule and WMQ.  
    Highflight-reservation

    Processes collections iteratively without losing any of the payload.

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

    Highjdbc

    Uses JDBC endpoints and SQL queries together to manipulate data.

    Sets properties on messages and parses and transforms message payload data.

    Handles errors with a customized exception strategy

     
    HighsecurityImplements application-layer security on a SOAP Web service. 

     

    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 Example Project.
      3. In the New Example Project wizard, click to select a Runtime, then click to select a Template.

         

        How do I get Mule Community runtime?

      4. Adjust the Project Name, if you wish, then click Finish to open the new example 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