Over a million developers have joined DZone.

Remote Debugging Mule Application

DZone's Guide to

Remote Debugging Mule Application

In this article, we demonstrate how you can access and debug your Mule application remotely. Just image debugging while sipping Mai Thai on the beach.

· Performance Zone ·
Free Resource

Learn how error monitoring with Sentry closes the gap between the product team and your customers. With Sentry, you can focus on what you do best: building and scaling software that makes your users’ lives better.


Occasionally, we have to debug a Mule application remotely, where the error condition is difficult to reproduce locally. The documentation on this is very scarce. This short post is to demonstrate how to do remote debugging.


Currently, the remote debugging of Mule applications is not supported for the CloudHub application. 


Update wrapper.conf

# enable remote debugging

Line 2 is to declare the environment. In my application, I define a secure property placeholder. mule.env=dev indicates that mule.dev.properties will be loaded. Line 3 is the key to the vault.

Line 5 is debugging port.

 <secure-property-placeholder:config name="Secure_Property_Placeholder" encryptionAlgorithm="Blowfish" key="${vault.key}" location="mule.${mule.env}.properties" doc:name="Secure Property Placeholder"/>

Verify Opening Ports 

On the Linux server, execute the following commands:

lsof -iTCP -n -P| egrep LISTEN 

I can see the following:

java      16998 mule    4u  IPv4 430599484      0t0  TCP (LISTEN)
java      16998 mule   38u  IPv4 430596802      0t0  TCP *:37236 (LISTEN)
java      16998 mule   39u  IPv4 430596803      0t0  TCP *:2003 (LISTEN)
java      16998 mule   40u  IPv4 430596805      0t0  TCP *:45693 (LISTEN)
java      16998 mule  446u  IPv4 430603723      0t0  TCP *:7779 (LISTEN)
java      16998 mule  608u  IPv4 430603851      0t0  TCP *:6767 (LISTEN)
java      16998 mule  714u  IPv4 430599549      0t0  TCP *:9999 (LISTEN)
java      16998 mule  751u  IPv4 430609773      0t0  TCP *:18081 (LISTEN)

As you can see, I have an HTTP port (18081) open. This is my application's HTTP listening port. 6767 is the debugging port. 7779 is the mmc port.

Configure Mule Anypoint Studio

Right click on project

Image title

Remote Mule Application --> New_Configuration

Image title

Click 'Debug.'

Now debug is running. To very this, we can use the following command in the local environment:

gl17@Gary-Liu-17s-MacBook-Pro:~/.m2$ lsof -iTCP -P -n | egrep 6767
AnypointS 4718 gl17  121u  IPv6 0xf9dcc2212fc961c3      0t0  TCP> (ESTABLISHED)

As you can see, the connection has been established with remote server

I can invoke the service now. Before I run this, in my studio, I can see the following:

Image title

Note: if you look at the console in Anypoint Studio, there is no information at this point. And it will never show any information, as we connect to the remote server.

Once I invoke the service with http://snapip01:18081/xpo I can see the following:

Image title

Now I can walk through the code.

Take Away

The main purpose of this article is to demonstrate the procedure to set up remote debugging and how to check it.

The following commands are very useful:

lsof -iTCP -P -n | egrep 6767
lsof -iTCP -n -P | egrep LISTEN

What’s the best way to boost the efficiency of your product team and ship with confidence? Check out this ebook to learn how Sentry's real-time error monitoring helps developers stay in their workflow to fix bugs before the user even knows there’s a problem.

remote debugging ,mule runtime ,performance ,mule performance

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}