1、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 theMule Debugger View, you can browse through the contents of the message
2、as it exists at that point in the flow, and evaluateMule Expressionsagainst the message.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.AssumptionsThis document assumes that you are
3、familiar with theVisual Editor in Mule Studio, particularlyStudio Building Blocks.Review theGetting Started with Mule Studiochapter to learn more about developing with Mule ESBs graphical user interface.PrerequisitesWhen debugging on your local machine, Studio Visual Debugger listens for incoming TC
4、P 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 Visu
5、al Debugger) and the ESB servers debug port, by default 6666. Ensure that there are no routing issues or firewalls blocking access between your host and the ESB servers debug port.(For additional information on remote debugging, see the sectionDebugging Remotelyin this page.)Testing connectivity to
6、a remote Mule ESB server with the telnet commandUsing the Visual DebuggerComplete the following macro-steps to use the Visual Debugger in Studio.1. Setbreakpoints on building blocks in your application.2. Runthe application in Debug mode.3. Viewand/orevaluatethe data in the first building block with
7、 a breakpoint.4. Resume application execution.5. Repeat step 3 with the next building block with a breakpoint, if any.Setting Breakpoints1. Right-click a building block, then selectToggle breakpoint.2. Studio applies a red dot to the building blocks icon on the canvas.When you run your application i
8、n Debug mode, Studio stops the flow execution at the breakpoint you have set, allowing you to check the message contents in theMule Debugger View.Running in Debug Mode1. In thePackage Explorerpane, right-click your application, then selectDebug AsMule Application. Studio begins running the applicati
9、on in Debug mode, and displays theConfirm Perspective Switchwindow.2. ClickYesto open the Debug perspective, from which you can access the full functionality of the Visual Debugger.Viewing Message Data at a BreakpointWhen you begin running your application in Debug mode, Mule opens theMule Debugpers
10、pective. 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.NumberDescription1Mule Debugger Viewdisplays informatio
11、n about a message when the flow execution reaches a breakpoint. In the image above, the application running in Debug mode has not yet received any message, so Studio displays no message information.2Mule Breakpoint Watchestab displays the Mule Breakpoint Watches pane, where you can add, remove and e
12、dit Mule breakpoint watches.3Mule Breakpoints Viewprovides a listing of all breakpoints set in all Studio applications.4Displays breakpoints in the Mule Breakpoints View.5Checkbox for setting a breakpoint asConditional. Below it is the input field for entering the desired condition. In the image abo
13、ve, the checkbox and the input field are grayed-out because no breakpoint is selected in the Mule Breakpoints View.When a message arrives at the first breakpoint, thedisplays two panes, as shown below.The left pane displays the message payload (in this case, an HTTP GET request received via anHTTP i
14、nbound endpoint). The right pane displays various metadata associated with the message: Inbound: message information (payload and metadata) if the message is inbound or within Mule Variables: active Mule variables at execution breakpoint Outbound: message information (payload and metadata) if the me
15、ssage is outbound Session: active session variables at execution breakpointTo resume execution, click theResumeicon (see below)or pressF8. Your application runs until the message reaches the next breakpoint, if any.Rather than simply resuming execution, you can choose to go to the next message proce
16、ssor, skip to a selected message processor, or stop the application. SeeExecution Control Toolsfor full details.Mule Debugger ViewThis section contains a full description of the Mule Debugger View and all its available tools.Left PaneThe left pane displays the message payload as a tree structure.Rem
17、arksNamecolumn displays the name of each message property.The first property displayed is always the name of the message processor.ValuecolumnTypeName of a message property.To see any nested elements for a property, click the arrow next to the property name . You can see all objects in the message p
18、ayload.Value of each message propertyOn some message processors, you can change the message payload by editing the payload properties. Visual Debugger automatically stores the modified payload object. When you resume running the application, the message progresses with the modified value.To edit a m
19、essage property:1. Click the value you wish to change.2. Type a new value.3. PressEnter.Right PaneThe right pane displays message metadata.6Inboundpane displays message data if the message processor is an inbound endpoint.7Variablespane displays any Mule variable currently active.8Outboundpane displ
20、ays message data if the message processor is an outbound endpoint.9Sessionpane displays any session variable currently active.Execution Control ToolsUse the tools described in the table below to perform actions in Mule Debug perspective.IconShortcut10Terminate Click to stop the currently running app
21、lication.11Evaluate Mule Expression Click to evaluate a Mule expression.Mac:Command+SHIFT+iLinux and Windows:Ctrl+SHIFT+i12Next Processor Click to run the application and stop at the next message processor in the flow, even if there is no breakpoint at the next processor.F613Run to Processor Click t
22、o run the application and stop at the currently selected processor, even if there is no breakpoint at the currently selected processor. Emulates the behavior of the Run to cursor option in Java debuggers. (To select a processor, single-click its building block in the canvas.)F714Resume Click to run
23、the application until the next breakpoint, if any.F8Evaluating Mule ExpressionsComplete the following steps to test a Mule expression against the message processor set with a breakpoint.1. Ensure that Studio has stopped flow execution at the desired breakpoint. When stopped, the breakpoint appears s
24、urrounded by a dotted blue line in the canvas, and Studio populates thewith information.2. Click theEvaluate Mule Expressioniconabove the right-hand pane in the Mule Debugger View. Studio displays the expression evaluation window (with yellow background in the image below).3. Type the Mule expressio
25、n you wish to evaluate in the provided input field, then pressenter. Studio evaluates the expression, then displays the result in theName,andcolumns.For instance, in the exampleabove, the message is an HTTP request containing two properties,SymbolMethod. To see the value forMethod, enter#message.inb
26、oundPropertiesMethod, then pressUsing the expression evaluation window, you can also edit message properties or attributes. Simply right-click the property value or attribute, type the new value, then pressenter.Setting Breakpoint ParametersYou can configure breakpoints according to three parameters
27、, described in the table below. These parameters are set in theMule Breakpoints View.TypeDefault (no parameters)Default configuration for a user-defined breakpoint. The breakpoint is set on a user-defined building block, and activated by default. When a message reaches the breakpoint building block,
28、 Studio stops flow execution and displays the contents of the message in the Mule Debugger View.ConditionalThe breakpoint is activated only if a user-defined condition evaluates totrue.ExceptionThis is a global parameter. When set, Studio stops flow executionat any building blockwhere an exception o
29、ccurs. The Mule Debugger View will display the message contents at the building block that threw the exception.Set these parameters in theMule Breakpointsview, described below.Mule Breakpoints ViewThis view displays all breakpoints defined in all the applications currently open in Studio. To access theview, ensure that you are currently in theDebug Perspective. (If not, clickunder the main toolbar). From t
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1