You are viewing an older version of this section. Click here to navigate to the latest version.

[MULE3EXAMPLES:Mule 3.2] Widget Factory Example

image These are instructions for running the Widget example in Mule 3.2. To run it in Mile 3.1, see here.

This example illustrates the use of Mule’s High Availability (HA) module for failover.

Running the example

Note: in order to run this example you need a Mule Cluster.

  1. From one (and only one) of the Mule installations in the cluster, run
    the command line client (widget / widget.bat) which is in the
    examples/widget directory, this will start up a JMS server used by
    all Mule instances in the cluster (if you start up more than one you
    will get port conflicts). Write down the IP of that machine.

  2. Open "examples/widget/src/main/app/mule-config.xml" and replace "localhost" with the IP you just wrote down, so that all nodes consume the same queue.

  3. Run "mvn" inside the "examples/widget" directory. This will recompile the example introducing our change and generate a zip file with the new application.

  4. Use the Mule Enterprise Management Console to deploy the pre-built
    widget application ( to the cluster.

  5. The widget application is now ready to be run.

Testing the example

  1. From the command line client, send some widgets to be manufactured. You
    should see them being processed by the different instances in the cluster.

  2. Now, shut down one of the instances in the cluster.

  3. You should see widgets continue to be manufactured by the remaining

  4. Restart the instance that was shut down in step 2.

  5. Once that instance has finished restarting, you will see it resume
    manufacturing widgets.

For more information, see Mule High Availability