Skip to content

Debugging Mediation

Debugging with External Micro Integrator

  1. Download and install the Micro Integrator server and on your computer.

  2. Launch Visual Studio Code with the Micro Integrator Extension installed.

  3. Select the artifact that requires debugging from the Project Overview page.

    project overview

  4. Then select the relevant resource from the Service Designer page in order to open the Diagram View of the resource.

    service designer

  5. To add a breakpoint to a mediator, in the Diagram View click on the Options icon on the right side of the mediator name and select Add Breakpoint.

    add breakpoint

    Note

    To remove a breakpoint from a mediator, click on the Options icon on the right side of the mediator name and select Remove Breakpoint.

    remove breakpoint

  6. Configure a new MI server without any previously deployed integrations to avoid conflicts by following the steps below.

    1. Open the command palette in VS Code by entering Command+Shift+P on macOS and Ctrl+Shift+P on Windows.
    2. Select MI: Add MI server from the list of available commands.
    3. Select the folder where <MI_HOME> is located.

    Current server path

    Note

    Mediation debugging with the MI for VSCode extension is supported on Windows starting from MI server version 4.3.0.

  7. Select the Run and Debug extension from the left side panel and then click on the Run and Debug button.

    run debug

  8. Select MI: Run and Debug as the debugger.

    debugger selection

Then the server will start up in debug mode and the server logs can be viewed in the Terminal alongside with the Debug Console.

terminal view

Once the server is up, send a request to the Micro Integrator and start debugging the flow.

breakpoints

You can use the below controlling panel to debug the flow by performing operations like step over, restart, pause, and stop.

debugger controls

Information provided by the Debugger Tool

When your target artifact gets a request message and when the mediation flow reaches a mediator marked as a breakpoint, the message mediation process suspends at that point.

There are two segments in the Variables section, namely Server Internals and Message Envelope.

variables

You can view the message payload in the Message Envelope section and you can view the message mediation properties in the Server Internals section.

The Server Internals section contains properties of the following property scopes.

  • Axis2-Client Scope properties
  • Axis2 Scope properties
  • Operation Scope properties
  • Synapse Scope properties
  • Transport Scope properties

These properties can be further expanded in order to view information on the property keys and values of them as shown below.

properties expanded