Sorry.. that was pretty silly not to include the version wasn't it? Currently 3.1.
Some History: We are doing serialization over http.. and thus we are giving out client libraries. This means that we had clients that were using jdk1.4.. That prevented us from using 4.x because of the jdk5 dependency. That situation may have changed because I think *almost* everyone is now finally on jdk5.. I'll look at the feasibility of moving to 4.x In case I can't I'll still ask, is it possible to do what I am asking in 3.1 today? -k -----Original Message----- From: Oleg Kalnichevski [mailto:[email protected]] Sent: Wednesday, April 21, 2010 5:43 PM To: HttpClient User Discussion Subject: Re: Thread to inspect active connections On Wed, 2010-04-21 at 16:32 -0400, Brooks, Kenneth S wrote: > We are facing an issue where a connection to a server is made, the request is > sent, the server sends the response and the client never sees the request. > Ultimately we get a socket timeout because httpclient eventually gives up on > that request. > > The big problem we have is that this only happens about once every couple of > million requests over a 12 hour period (and not consistently). > > What we would like to do is increase the connection timeout to something > ridiculously long and put some sort of a watcher thread on the client side > that can sort of do what the IdleConnectionTimeoutThread is doing. > But instead of just calling the > connectionManager.closeIdleConnections(connectionTimeout); we would like to > interrogate each open connection to see how long it has been active. > If it has been active for longer than our idleconnection timeout (currently > 20 seconds) then we can perform some action.. > So lets say that if it was active for 1 minute then we would be able to know > the issue is happening and do something (like take thread dumps). > > Without doing that, we only know about the problem *after* it has happened > and the socket timeout has already been thrown.. > > That does me no good.. I want to see inside of the VM *as* its happening. > > Any thoughts on how to do this? > Kenneth, What version of HttpClient are you using? This is certainly doable (especially with HttpClient 4.0) but most likely would require a custom connection manager. JMX enabled version of the pooling connection manager would probably be the most sensible thing. Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
