How to run Mule Layer in the background

How do you run the application in the background

We all know about API led approach in MuleSoft, where we work with 3 layers e.g. experience layer, process layer and system layer. In smaller scale project you might not come across any problems but at enterprise applications, you might need to work with two or more layers at a time. Let’s assume, we are working with process layer which connects to system layer, while we’re working with process layer we might need to run the system layer as well to successfully run/debug the process layer. Because if your system layer is not available/running while you’re running/debugging process layer it will throw you error like below when it would try to connect to system layer.

“Error sending request to http://localhost:8081/somepath/

There are multiple ways you can solve this problem. One way import system and process layers projects into same workspace and then configure Run Configurations/Debug Configurations to run and/or debug both applications simultaneously.

Though it’s good way to go but there’s a major drawback of doing this and that is whenever you want to stop one application it will stop other application as well. That means, you might want to stop running process layer and do some modification but in the process it will also stop the system layer as well. Every time you want to run or debug the process layer, system layer will also start running which is not necessary and can be time consuming in case of large scale applications. What if you want to keep system layer running while you constantly working on process layer?

There is another drawback in this process which is more obvious. You can not change the way of running of each layer projects. That means, if you start your process layer in debug mode, it will also kick off system layer in debug mode. But what if you want to run process layer application in debug mode because you want to debug through the flows but you don’t want to debug system layer?

To address these drawbacks, Mule Runtime Standalone Engine comes to rescue. Let’s see how we can achieve this:

Step 1: Download and install JDK from . Please note JDK 1.8 with any minor version is recommended. Do not install JRE or JDK with different major version other than 1.8

Step 2: Download Mule 4 Standalone Runtime from

Step 3: Extract Mule 4 Runtime in root folder. I will demonstrate in terms of Windows OS. It’s recommended to put Mule 4 Runtime in any drives with less or no nested folder hierarchy. This is because Windows has character limitations in folder/file path which might be the issue while extracting contents from compressed folder.

Step 4: After extracting navigate inside Mule runtime folder and then navigate to /bin folder. Run command prompt/terminal window from that location.

Step 5: Execute following command to run Mule Runtime in your machine.

Windows: mule.bat (or mule)

Unix: sudo ./mule

This will kick off Mule Runtime Server in your machine. Wait for it to start.

Step 6: Once server is started navigate to the Mule Runtime installation location and look for /apps folder.

Step 7: Put your application deployable jar file inside that folder. In our case we want to run system layer in Mule Runtime. Let’s try to do that and have a look at the terminal window, you’ll see that your application will be deployed in some time.

Please note that if your application belongs to different domain other than default then you need to deploy your domain projects first before you can deploy your application otherwise it will throw error. To deploy your domain projects, navigate to the /domains folder and paste your domain project jar. It will kick off domain project and then you can follow Step 7 to deploy your application.

Now, your system layer application will run inside Mule Runtime while you can run or debug your process layer from Anypoint Studio. You don’t have to run system layer every time.

To see logs of applications running in your Mule Runtime, navigate to /logs folder inside your Mule Runtime installation directory, then you can see a log file has been created with same name as your application name.


Jyoti Choudhury

More relevant insights


A Mulesoft 4 Story – Connecting to Salesforce Marketing Cloud

Salesforce Marketing Cloud (SFMC) is predicted to be one of the most in-demand products from customers using Salesforce. The principal reason behind this choice is because businesses now understand the value of marketing to a customer on their preferred channel, whether that’s social media, on-site advertising, or email marketing. Historically, businesses have always struggled to …

A Mulesoft 4 Story – Connecting to Salesforce Marketing Cloud Read More »

Read More