ServiceClient setReadTimeout()

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

ServiceClient setReadTimeout()

Nestor Urquiza
Hi,

I am using Axis tcpmon SOAP monitor/HTTP proxy to simulate slow SOAP Server responses.

I can set certain delay between packets of certain length which is great to reproduce real problems we are experiencing from time to time with one of our service providers.

My client uses Axis2 ServiceClient and all I can see about timeouts is:
//options.setProperty(HTTPConstants.SO_TIMEOUT, new Integer(timeOutInMilliSeconds));
//options.setProperty(HTTPConstants.CONNECTION_TIMEOUT, new Integer(timeOutInMilliSeconds));
options.setTimeOutInMilliSeconds(timeOutInMilliSeconds);

The above does not address the problem of slow packets or servers just performing to many operations before sending back the whole SOAP response. Ideally there would be a way to tell the client just to timeout if the whole operation takes too much time.

I think this could be achieved accessing HttpURLConnection.setReadTimeout() however I feel like I will need to go deeper in Axis2 code to provide an answer to this.

This as a common problem to be solved: You do not want your client side to hang waiting for slow server responses. Ideally the client should timeout in circumstances like slow network throughput, high latency and so on.

I am wondering if someone could point me to the right direction.

many thanks,

-Nestor
Reply | Threaded
Open this post in threaded view
|

Re: ServiceClient setReadTimeout()

Nestor Urquiza
I ended up using ExecutorService from my code. Here is what I did http://thinkinginsoftware.blogspot.com/2011/03/handling-slow-soap-responses-in-client.html

Hopefully will help someone out there.

Best,

-Nestor