Hi everyone.  Using HttpClient 4.0.1, is it possible to set a maximum overall 
lifetime for pooled (persistent) connections?  I looked at implementing 
ConnectionKeepAliveStrategy, but I believe this is invoked for every request, 
so there is no way to "remember" when a connection was initially opened.

Currently I'm looking at creating a new sub-class of 
ThreadSafeClientConnManager, which in turn uses a new sub-class of 
DefaultClientConnectionOperator, which returns a connection wrapper that 
remembers when it's opened.  This could in turn be used by a 
ConnectionKeepAliveStrategy which knows to look for the special wrapped 
connection type and check how long it's been open.

It looks like the work for HTTPCLIENT-915 
(https://issues.apache.org/jira/browse/HTTPCLIENT-915) might help with this 
approach, eliminating the need for a special wrapper class.

All that being said, is there a recommended strategy?  Any feedback would be 
appreciated.

Sincerely,
Matt Solnit
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to