singleton httpclient

Jim Fox fox at washington.edu
Mon Nov 18 14:39:21 EST 2019


I'm curious why the HttpClient (v3.4) is implemented as a 
singleton, rather than, say, from a PoolingHttpClientConnectionManager.

It seems that the singleton client can be kept open, reducing connection 
build and destroy overhead, but it also single threads all requests.  With 
a pooling connectin manager we could have more than one always open 
client.

In addition, there is a setting (which is clearly not supposed to be changed) that 
undoes the singleton approach.  This however would seem to create a great 
many open connections, as a user of the httpclient will not be closing it.

Thanks,

Jim


More information about the dev mailing list