Debugging WSO2 Enterprise Integrator using TCP/IP monitor

Krishni Andradi
WSO2 Solution Architecture Team Blog
4 min readJun 10, 2019

WSO2 Enterprise Integrator is a full comprehensive integration solution which enables communication among various disparate applications.

So the integration process involves in

  • invoking several applications
  • database operations
  • message routing
  • message transformations

Since there will be hundreds of integration components running within one message flow, it will be really difficult to identify a failure point.

When it comes to breakpoints we may need to start WSO2 EI server in debug mode which adds a latency of starting servers.

So here I’m going to explain you a method to do debugging without starting WSO2 EI server.

What does TCP/IP monitor do?

TCP/IP monitor act as a simple server that monitors all the request going through and responses coming to EI.

As well as we can use TCP/IP monitor to capture invoke latencies and we can use TCP/IP monitor to block certain invocations during test time.

Using TCP/IP monitor

I do have the following Enterprise Integrator service, Which will handle online order request. First, it will check items in the inventory, and then it will proceed the payment for the order. And after that, it will process orders in the order handling system.

So I have got three endpoints

  1. Inventory system (https://172.25.37.172:8080/inventory)
  2. Payment system (https://168.34.34.125:9080/payment)
  3. Order processing system (https://198.125.125.16:7800/order)

Now I want to monitor incoming and outgoing requests to above three endpoints

What TCP/IP monitor does is intercepting these URLs by a specific port in localhost. For example, we can add a monitor to TCP/IP monitor saying if a request comes to localhost port 5900 redirect it to 172.25.37.172:8080

So following will be TCP/IP URLs for above endpoints

Inventory system

actual URL > https://172.25.37.172:8080/inventory)

new URL > https://localhost:7801/inventory

Payment system

actual URL > https://168.34.34.125:9080/payment

new URL > https://localhost:7802/payment

Order system

actual URL > https://198.125.125.16:7800/order

new URL > https://localhost:7803/order

Step 1. Open TCP/IP monitor

Open integration studio* or your eclipse IDE. Go to Window> Show View > Others >Debug>TCP/IP monitor

Step 2.

Go to the arrow in the upper right corner and go to properties

Step 3.

Now the preferences window will appear. Here you can specify the endpoints you want to monitor.

Step 4.

Add Endpoint monitors by clicking the add button. Below screen will appear. Now add one by one.

Here in the local monitoring port, you have to add the port which you are going to allocate in the localhost for monitoring that service. (for inventory system this is 7801)

The hostname is the actual URL hostname (for inventory system this is 172.25.37.172)

Port is the port in the actual URL (for inventory system this is 8080)

Step 5. Select the created TCP/IP monitors in the preferences tab. and Click start. you will need to start all monitors one by one.

Step 6. Click apply and close button.

Step 7. Now go to your EI endpoints and add representing localhost URLs instead of actual URL s.

Step 8. Now redeploy and invoke your service.

You will be able to see all invocation request and response data payloads in the TCP/IP monitor window.

There when you select particular invoke, you will see its request time, response time, input payload, output payload, request size, response size, and headers. You can differ response viewer type and encoding type based on your invoke types.

Now let’s say you want to test the behavior of the Message Flow when the payment service is unreachable. Now what you can do is go and stop the TCP/IP monitor related to that payment process and invoke your flow.

I think this post will help you to debug your system easily. Happy debugging.

And please remember to change your endpoint URLs to actual endpoint URLs before deploying it to the production environment.

Thank You :)

Note:

Integration Studio is a simple graphical editor based on eclipse developer environment, which is ideal for developing and managing artifacts.

You can download Integration studio from here :

https://wso2.com/integration/tooling/

--

--