singleton httpclient

Brent Putman putmanb at georgetown.edu
Mon Nov 18 16:36:25 EST 2019


On 11/18/19 4:03 PM, Cantor, Scott wrote:
> 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.


Yes, that's correct as far as I know.  The Apache builder, which our
builder wraps, defaults to a PoolingHttpClientConnectionManager, so
that's what you get by default.


>
> 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.


Yes, I don't think that changes the connection manager you get, just the
TLS socket factory.  So you'll still get the pooling conn mgr.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/dev/attachments/20191118/f4104999/attachment.html>


More information about the dev mailing list