Polling TCP client connector

motif

Right now TCP inbound endpoints are implemented as TCP servers that listen for data coming from different clients. In Mule ESB 2.2.6 we are adding a new feature to inverse the control: TCP inbounds can now poll data from remote servers.

It is really easy to switch to this strategy. Let’s take a look of how a mule configuration looks like:

Notice the new tcp:polling-connector element in the mule configuration file. This element tells mule to poll data with a frequency of 1000ms and a timeout of 3000ms.
Using the above configuration we can create a TCP server that writes messages like this:

You can check the value received in the out outbound using the MuleClient like this:

The receivedMessage variable will hold the received value from the TCP Server.

If you want to try it, please download Mule ESB 2.2.6 or the latest 3.0 milestone