>
> +
>

> Hi All,
>
>
>
>    We are upgrading the httpclient in our software from 3.1 to 4.5 (we are
> adding both core and client). But we are having some issues in the client
> and server communications. We are using the below client code (simplified
> the code ) to make a  call every 60 secs and we are getting localhost not
> responding after few tries.
>
> Client code simplified is :
>
> RequestConfig config = RequestConfig.*custom*()
>
>               .setConnectTimeout(20 * 1000)
>
>               .setConnectionRequestTimeout(10* 60 * 1000)
>
>               .*setStaleConnectionCheckEnabled**(**true**)*
>
>               .setSocketTimeout(10 * 60 * 1000).build();
>
> *this*.client = HttpClients.*custom*().setDefaultRequestConfig(config
> ).build();
>
> HttpResponse response = client.execute(postMethod);
>
> *int* rc = response.getStatusLine().getStatusCode();
>
> *if* (rc > 200) {
>
>       log error
>
> }
>
> //using the object stream to read data..
>
> ois = *new* ObjectInputStream(response.getEntity().getContent());
>
> //at the end we close it
>
> postMethod.releaseConnection();
>
>
>
> But still we are getting the following issue:
>
>
> ​[image: cid:image003.png@01D2B446.A78B7290]
>
>
>
> Any recommendations would be appreciated. we have 2 thread making a
> request every 60 secs. When we used a spooling manager always one route was
> used..
>
    May be both thread that are calling the same URL simultaneously are
sharing one connection , but they should share different connections..

>
>
> Thanks
>
>
>
> *Hassan Khan*
>
> Software Developer
>
>

Reply via email to