From the technical centre of excellence of Massil Technologies, our technology leaders make it easy to understand the complex situations you come across in Mule ESB from the experience of Massil Technologies to have countered them in their experience of working on client projects in real time. This blog talks about determining the source of inbound endpoints in Mule ESB. This blog is a part of series of blogs being authored and published by Massil Technologies for the benefit of the IT community globally.
Imagine a situation where you were given a ton of xml files containing mule flows and you need to draw the process diagrams showing the message paths between the flows. While working on the same, you will see inbound endpoints and then outbound endpoints. As you were tasked to draw process diagrams, it is important for you to fine the source of inbound end points. You also make need to understand whether the inbound endpoints come as outbound endpoints from other flows or where do they come from and where do they go?
Based on our understanding at Massil Technologies, the below steps worked out great for us.
Run your project in debug mode in your Anypoint Studio. Ensure that you have put a breakpoint to it, then do a step-by-step run. You may need to do this if there are several scenarios for every inbound payload.
CREATING A NEW PROJECT:
In The Anypoint studio top left click on the file => New => Mule Project, Click on the Mule Project enter the your project name and click finish.
Drag and drop the connecters you required from the Mule Palette to the canvas. In this case we drag and drop the HTTP connector and setpayload and logger for simple debugging process.
Studio’s Visual Debugger allows you to run your application in Debug mode, stopping execution to check the contents of a message at previously-specified building blocks.
To do this, you set a breakpoint at any building block in your flow that you wish to check or test (see image below). When you run your application in Debug mode, the application stops immediately after executing the building block with the breakpoint. Using the Mule Debugger View, you can browse through the contents of the message as it exists at that point in the flow, and evaluate Mule Expressions against the message.
Studio Debugger only works with Enterprise Edition runtimes and does not connect to Comunity Edition runtimes.
Note that the Visual Debugger is completely distinct from the Java Debugger contained in Studio. In fact, you may run both debuggers concurrently on your application.
When debugging on your local machine, Studio Visual Debugger listens for incoming TCP connections on localhost port 6666. This port must be available on your machine, i.e. not blocked by a firewall or other security software.
If you plan to remotely debug an application running in an external Mule ESB server, you will need connectivity between your machine (where you run Studio Visual Debugger) and the ESB server’s debug port, by default 6666. Ensure that there are no routing issues or firewalls blocking access between your host and the ESB server’s debug port.
Setting Breakpoints :
Right-click a building block, then select Toggle breakpoint.
Studio applies a red dot to the building block’s icon on the canvas.
When you run your application in Debug mode, Studio stops the flow execution at the breakpoint you have set, allowing you to check the message contents in the Mule Debugger View.
Running in Debug Mode
In the Package Explorer pane, right-click your application, then select Debug As > Mule Application. Studio begins running the application in Debug mode, and displays the Confirm Perspective Switch window.
Click Yes to open the Debug perspective, from which you can access the full functionality of the Visual Debugger.
Viewing Message Data at a Breakpoint
When you begin running your application in Debug mode, Mule opens the Mule Debug perspective. Until a message arrives at the first breakpoint, the Mule Debugger View in the console displays a message that reads, “Connected with mule ESB. Waiting for a mule message to arrive!”
The image below illustrates the Mule Debug perspective
When a message arrives at the first breakpoint, the Mule Debugger View displays two panes, as shown below
In this case you check the payload by using X+Y=? symbol from the HTTP connector it will give the nullpayload press F6 to the next processor and F7 Run To Processor and F8 Resume press F6 to the check payload coming from setpayload shown below
From the setpayload we get the payload/hello because in the setpayload we write value like.
it will takes the value from browser http path like below…
So finally we get the payload in console and browser
Hence, we have gone through the step by step process to depict the way Massil Technologies team has addressed. Hope this article from Massil Technologies was useful for you. If you have any further queries on this topic, please reach out to email@example.com.