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
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]