On Thu, 2015-09-03 at 13:13 -0600, Shawn Heisey wrote:
> On 9/3/2015 10:57 AM, Shawn Heisey wrote:
> > I don't see anything in the file my start script creates by
> > redirecting stdout, though. If everything were working right,
> > shouldn't I see output from setting the timeout in my own code?
> 
> I replaced the client construction using Solr's HttpClientUtil with the
> following, which I came up with after reading the
> ClientConfiguration.java example on the HC website:
> 
>   /* Trying out a new way of creating clients */
>   RequestConfig requestConfig = RequestConfig.custom()
>       .setSocketTimeout(900000)
>       .setConnectTimeout(15000)
>       .build();
>   httpClient = HttpClients.custom()
>       .setDefaultRequestConfig(requestConfig)
>       .setMaxConnPerRoute(300)
>       .setMaxConnTotal(5000)
>       .build();
>   RequestConfig optimizeRequestConfig = RequestConfig.custom()
>       .setSocketTimeout(7200000)
>       .setConnectTimeout(15000)
>       .build();
>   optimizeHttpClient = HttpClients.custom()
>       .setDefaultRequestConfig(optimizeRequestConfig)
>       .build();
> 
> The httpClient and optimizeHttpClient instances are defined like this:
> 
>   /**
>    * A static http client to use on Solr client objects.
>    */
>   private static HttpClient httpClient = null;
> 
>   /**
>    * A static http client to use on Solr client objects. This one is for
> doing
>    * optimizes, will use a much longer socket timeout.
>    */
>   private static HttpClient optimizeHttpClient = null;
> 
> I am still seeing nothing in stdout, even though there's an added
> System.out.println in BHttpResponseBase.java at the recommended location.
> 
> Am I doing something wrong in my attempts to debug this problem?
> 

Shawn

I added socket timeout logging to the 4.5.x branch and trunk

http://svn.apache.org/r1701258

I clearly those values logged when executing HttpClient examples. 

---
[DEBUG] RequestAddCookies - CookieSpec selected: default
[DEBUG] RequestAuthCache - Auth cache not set in the context
[DEBUG] PoolingHttpClientConnectionManager - Connection request: [route: 
{}->http://httpbin.org:80][total kept alive: 0; route allocated: 0 of 10; total 
allocated: 0 of 100]
[DEBUG] PoolingHttpClientConnectionManager - Connection leased: [id: 0][route: 
{}->http://httpbin.org:80][total kept alive: 0; route allocated: 1 of 10; total 
allocated: 1 of 100]
[DEBUG] MainClientExec - Opening connection {}->http://httpbin.org:80
[DEBUG] DefaultHttpClientConnectionOperator - Connecting to 
httpbin.org/54.175.219.8:80
[DEBUG] DefaultHttpClientConnectionOperator - Connection established 
10.0.0.8:55361<->54.175.219.8:80
[DEBUG] DefaultManagedHttpClientConnection - http-outgoing-0: set socket 
timeout to 5000
[DEBUG] MainClientExec - Executing request GET /get HTTP/1.1
---

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org

Reply via email to