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.
mule_installation_dir}/conf/gslicense.xml and enter your license key there.
Prepare 2 Mule installations (1 primary, 1 backup) with HA enabled as explained here.
From one (and only one) of the Mule installations, run the command line client (
widget.bat) which is in the
examples/widgetdirectory, this will start up a JMS server used by both Mule instances (if you start up more than one you will get port conflicts).
Deploy the pre-built widget application (
mule-example-widget.zip) to the
$MULE_HOME/appsdirectory of both Mule installations and wait for them to start up.
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.
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.
Now simulate a failure of the primary instance (e.g.,
Ctrl-Cfrom the Mule console or
kill -9with the Mule process ID)
You should see the backup instance detect the primary node failure and its services start up.
Send some more widgets to be manufactured, you should now see them being processed by the backup instance.
Simulate a recovery of the primary instance (start up Mule again).
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