[Download ] | [Documentation Home ] | [Release Note ]

TCPMon Guide

The aim of this simple tutorial is to explain how the TCPMon works. It explains how messages are exchanged and other important features such as Slow Connection Simulation and HTTP Proxy Support.

Content

Introduction

TCPMon is a utility that allows the user to monitor the messages passed along in a TCP based conversation. It is based on a swing UI and works on almost all the platforms that Java supports.

The script file, tcpmon.{sh|bat} to run this tool is located in the "bin" folder of the WSO2 WSAS distribution.

Structure and Dependencies

TCPMon has absolutely no dependencies on third party libraries. TCPMon needs a JRE that is 1.4 or higher.

Usage Patterns

As an Explicit Intermediate

The most common usage pattern for the TCPMon is as an intermediary. It is called explicit since the client has to send the messages to the intermediary rather than to the original endpoint in order to monitor the messages. The following figure explains this concept.



Figure 1: concept



In order to start the TCPMon in this configuration, you have to provide the target host name and port as well as the listening port on the Admin tab. See the image below.

Figure 2: first screen



Click 'Add' to open a new tab that displays the messages to be seen, as displayed in the following screen.



Figure 3: message screen



At this point, the requester should point to the listener port of the TCPMon instead of the original endpoint. Let us understand this with an example:

For example, we need to monitor all the messages that are sent to and from www.apache.org.

Step 1 - Add a listener with the host as www.apache.org and port as 80. Set the listener to port 8080, which may be any unused port in the local machine.



Figure 4: the settings



Step 2 - Point the browser to the localhost:8080 instead of www.apache.org.



Figure 5: browser address bar

Once the exchange of messages start, they can be seen on the relevant tab as seen below.



Figure 6: Filled screen



The options at the bottom of the screen can be used to have the messages in XML format (useful in debugging Web services), save and resend the messages, and also to switch the layout of the message windows.



Figure 7: button set



As a Request Sender for Web Services

TCPMon can also be used as a request sender for Web services. The request SOAP message can be pasted on the send screen and then sent directly to the server.



Figure 8: request sender



As a Proxy

TCPMon can act as a proxy. To start the TCPMon in proxy mode, just select the Proxy option. When acting as a proxy, TCPMon only needs the listener port to be configured.



Figure 9: proxy



Advanced Settings

Slow Connection Simulation

TCPMon can simulate a slow connection, in which case the delay and the bytes to be dropped can be configured. This is specially useful in testing Web services.



Figure 10: slow-connection



HTTP Proxy support

If HTTP proxy support is required, then that can also be set on the admin screen.

Conclusion

TCPMon is a simple and easy to use tool that has many benefits when developing message driven applications. It is particularly useful in developing Web services.