I'm trying to upgrade from Httpclient 3.1 to HttpClient 4.0b2 because I read that it would be more performant, but I am finding it to be highly problematic in that it doesn't keep alive connections like 3.1 did. I have a Servlet application written w/ 3.1 that has rock solid Established connections.
After much pain and suffering for a week now, I cannot get HttpClient 4.0b2 to perform the same way. Connections keep going up and down. Some seem to stay up for a long time, but others never. I have a need to run like 40 worker threads that use a connection pool to a remote data center. I need to timeout the worker threads to make sure that they don't wait too long for a response as I also have a ton of incoming servlet threads producign new work. In 3.1, I spun up an additional TimerTask thread to interrupt() the worker thread if the Http connection took too long. I did this because the setSocketTimeout() expiring would close the socket and force the connection to re-establish. I'm doing the same thing w/ 4.1b2, but am starting to wonder if that's not the "approved" model to timeout connections w/o losing the keep-alive on them. Should I be doing this a different way? I want to free up my worker thread if the http request/response takes too long, but I also want the socket to stay open. Help! I've already lost a week struggling with this. -- View this message in context: http://www.nabble.com/HTTPClient-4.0B2-does-not-persist-connections--tp22981057p22981057.html Sent from the HttpClient-User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
