How to configure the number of retries HtmlUnit request in Spring?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to configure the number of retries HtmlUnit request in Spring?

makson
This post has NOT been accepted by the mailing list yet.
I have a webservice which is accepting a POST method with XML. It is working fine then at some random occasion, it fails to communicate to the server throwing IOException with message The target server failed to respond.
19:32:01.489 [main] DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection released: [id: 5][route: {}->http://][total kept alive: 0; route allocated: 0 of 6; total allocated: 0 of 20]
19:32:01.489 [main] INFO org.apache.http.impl.execchain.RetryExec - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}->http:// The target server failed to respond
19:32:01.489 [main] DEBUG org.apache.http.impl.execchain.RetryExec - The target server failed to respond
org.apache.http.NoHttpResponseException: The target server failed to respond

I see that some random requests is accept, but some reject. This situations was then I use Spring Boot! Because container doesn't handle response many (3) times. If I run test without spring, request executed per 3 attempts. is it possible to configure the number of retries and if how?
Or how to avoid this problem and execute request at once?