hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: ConnManagerParams.setTimeout
Date Fri, 09 Nov 2012 17:26:27 GMT
On Fri, 2012-11-09 at 04:55 -0800, Mike Boyers wrote:
> I think there is an issue with the current javadoc for ConnManagerParams.
> 
> When I first began using HttpComponents/Client v4.0, I would use
> 
> ConnManagerParams.setTimeout(timeout)
> 
> to
>  configure the timeout on the connection manager.  In my case, I set 
> this very low because when any pool is at its maximum configured size, I
>  want to fail fast and not wait for a connection to free up from the 
> pool.
> 
> In looking at the source code, this effectively called:
> 
> params.setLongParameter("http.conn-manager.timeout", timeout);
> 
> 
> In upgrading to the current 4.2.2 version, ConnManagerParams is deprecated.  The javadoc
(http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/conn/params/ConnManagerParams.html)
says to use
> 
> HttpConnectionParams.setConnectionTimeout(params, timeout)
> 
> but in looking at the source code, it looks like this effectively does the following:
> 
> params.setIntParameter("http.connection.timeout", timeout)
> 
> And when I've tested this method, it seems like it has no effect on the connection manager
timeout.  If I instead use
> 
> params.setParameter(ClientPNames.CONN_MANAGER_TIMEOUT, timeout)
> 
> it seems to work as I would expect.
> 
> Does this seem accurate?  If so, is params.setParameter(ClientPNames.CONN_MANAGER_TIMEOUT,
timeout) the preferred technique for setting the connection manager timeout going forward?
> 
> Thanks,
> Mike
> 

Mike

HttpClient's configuration API is a mess. I am working on fairly major
changes in that area in the trunk (4.3 series). Everything HttpParams
related should be gone (deprecated) in the next feature release and
replaced by plain old java objects.

Oleg



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


Mime
View raw message