Keep Mule Windows Service running 24/7 with Service Protector

How to Keep the Mule Windows Service Running 24/7 with Service Protector

Automatically restart your Mule Runtime/ESB if it stops for any reason. Survive crashes, JVM memory leaks, accidental shutdowns, etc.

The Mule Runtime Engine is a powerful Java-based enterprise service bus (ESB) and integration framework provided by MuleSoft. The software can be installed as a Windows Service to run unattended in the background for 24x7 operation:

To protect the Mule Windows Service with Service Protector:

  1. Download and install Service Protector, if necessary.

  2. Start Service Protector.

  3. Select Protector > Add to open the Add Protector window:

    Add Protector

  4. On the General tab, in the Service to protect field, choose the Mule windows service. You will see a green circle beside the name if the service is already running:

    Mule Windows Service: General Tab

  5. If you find that your Mule server occasionally crashes or hangs up after prolonged use, we recommend restarting the service periodically at a "quiet time". To do so:

    • Switch to the Monitor tab.
    • Check the At the following times box.
    • Click the Add... button to summon the Add Time window.
    • Specify a good time to restart the service (which should only take a few seconds). We'll enter "Every Sunday at 3 AM". Note that you can choose to reboot the entire PC at that time if that is appropriate for your situation.
    • Click the OK button to record your time.

    Mule Windows Service: Monitor Tab

  6. We are now done configuring the basics, so click the Save button to record your settings. In a few seconds, an entry for the Mule service will show up in Service Protector's window.

    The row will say Protected in the Protection column, which means that Mule is already being monitored for unexpected shutdowns.

    Mule Windows Service: Created

    You can click on that green shield to show a few details of the monitoring:

    Mule Windows Service: Details

  7. That's it! Next time your computer boots, the Mule service will start up automatically (as normal) and Service Protector will start monitoring the service to restart it quickly it if it crashes or stops for any reason.

    We encourage you to edit the Mule entry in Service Protector and check out the many other settings that may be helpful in your environment. For example, send email when the service fails, automatically restart if the service gets "stuck" stopping or starting, and much more.



Trouble protecting the Mule Windows Service?