Free MuleSoft CONNECT Keynote & Expo Pass Available!

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

Widget Factory Example

These are instructions for running the Widget example in Mule 3.1.

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

In order to run this example you need a GigaSpaces license key.

Edit \{mule_installation_dir}/conf/gslicense.xml and enter your license key there.

Running the example

  1. Prepare 2 Mule installations (1 primary, 1 backup) with HA enabled as explained here.

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

  3. Deploy the pre-built widget application ( to the $MULE_HOME/apps directory of both Mule installations and wait for them to start up.

  4. The widget factory is now in a ready state. You should see that the services of the primary Mule instance are started, but the services of the backup instance are stopped.

Testing the example

  1. From the command line client, send some widgets to be manufactured, you should see them being processed by the primary instance but not the backup instance.

  2. Now simulate a failure of the primary instance (e.g., Ctrl-C from the Mule console or kill -9 with the Mule process ID)

  3. You should see the backup instance detect the primary node failure and its services start up.

  4. Send some more widgets to be manufactured, you should now see them being processed by the backup instance.

  5. Simulate a recovery of the primary instance (start up Mule again).

  6. You should see that the instance starts up, but its services are stopped because the primary instance has now become the new backup.

For more information, see Mule High Availability