singleton httpclient
Cantor, Scott
cantor.2 at osu.edu
Mon Nov 18 16:03:11 EST 2019
On 11/18/19, 2:39 PM, "dev on behalf of Jim Fox" <dev-bounces at shibboleth.net on behalf of fox at washington.edu> wrote:
> I'm curious why the HttpClient (v3.4) is implemented as a
> singleton, rather than, say, from a PoolingHttpClientConnectionManager.
Brent would know better than I, but I don't think it is. We don't install our own ConnectionManager from what I can see, which means it auto-installs a PoolingHttpClientConnectionManager, and that's why the builder we have exposes properties like max connections and max per-route.
It's all a bit spaghetti, but that's how it read to me. I think I've tested that in the past and certainly seen it operate multiple connections at a time.
The TLS layer adds a lot of complexity to what we're doing, but I think all that is being done outside the scope of actually overriding its connection manager.
Note that all the components themselves by design should operate on HttpClient, so they don't assume anything, and there are no actual concrete beans that should ever be used for any clients of your own (that was a screw up on our part, the built-in clients in the system files are actually a source of a ton of Spring bugs that screw up service reloads as it turns out).
So in theory you can do anything you want.
-- Scott
More information about the dev
mailing list