Set connection TTL in adapters HttpClientBuilder

closes #17304
This commit is contained in:
Douglas Palmer 2023-03-02 15:45:11 -08:00 committed by Marek Posolda
parent a3f2ebb193
commit 52eeac76e1

View file

@ -305,7 +305,7 @@ public class HttpClientBuilder {
HttpClientConnectionManager cm; HttpClientConnectionManager cm;
if (connectionPoolSize > 0) { if (connectionPoolSize > 0) {
PoolingHttpClientConnectionManager tcm = new PoolingHttpClientConnectionManager(sf.build()); PoolingHttpClientConnectionManager tcm = new PoolingHttpClientConnectionManager(sf.build(), null, null, null, connectionTTL, connectionTTLUnit);
tcm.setMaxTotal(connectionPoolSize); tcm.setMaxTotal(connectionPoolSize);
if (maxPooledPerRoute == 0) maxPooledPerRoute = connectionPoolSize; if (maxPooledPerRoute == 0) maxPooledPerRoute = connectionPoolSize;
tcm.setDefaultMaxPerRoute(maxPooledPerRoute); tcm.setDefaultMaxPerRoute(maxPooledPerRoute);