[Download ] | [Documentation Home ] | [Release Note ]
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.
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.TCPMon has absolutely no dependencies on third party libraries. TCPMon needs a JRE that is 1.4 or higher.
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.
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.
Click 'Add' to open a new tab that displays the messages to be seen, as displayed in the following 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.
Step 2 - Point the browser to the localhost:8080 instead of www.apache.org.
Once the exchange of messages start, they can be seen on the relevant tab as seen below.
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.
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.
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.
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.
If HTTP proxy support is required, then that can also be set on the admin screen.
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.