Skip to content

Commit

Permalink
Merge pull request #872 from Alfresco/feature/ACS-6033_switch_to_pool…
Browse files Browse the repository at this point in the history
…able_connection_manager_for_restTemplate

Change to Poolable connection manager, due to RestTemplate provided f…
  • Loading branch information
mstrankowski authored Sep 22, 2023
2 parents d46dd7f + 82e83a2 commit 07cd158
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
import org.apache.hc.client5.http.impl.classic.HttpClientBuilder;
import org.apache.hc.client5.http.impl.classic.HttpClients;
import org.apache.hc.client5.http.impl.io.BasicHttpClientConnectionManager;
import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager;
import org.apache.hc.client5.http.socket.ConnectionSocketFactory;
import org.apache.hc.client5.http.ssl.NoopHostnameVerifier;
import org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory;
Expand Down Expand Up @@ -139,7 +139,7 @@ RegistryBuilder.<ConnectionSocketFactory> create()
.register("https", sslConnectionSocketFactory)
.build();

final BasicHttpClientConnectionManager sslConnectionManager = new BasicHttpClientConnectionManager(sslSocketFactoryRegistry);
final PoolingHttpClientConnectionManager sslConnectionManager = new PoolingHttpClientConnectionManager(sslSocketFactoryRegistry);

HttpClientBuilder httpClientBuilder = HttpClients.custom().setConnectionManager(sslConnectionManager);
CloseableHttpClient httpClient = httpClientBuilder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
import org.apache.hc.client5.http.impl.classic.HttpClientBuilder;
import org.apache.hc.client5.http.impl.classic.HttpClients;
import org.apache.hc.client5.http.impl.io.BasicHttpClientConnectionManager;
import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager;
import org.apache.hc.client5.http.socket.ConnectionSocketFactory;
import org.apache.hc.client5.http.ssl.NoopHostnameVerifier;
import org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory;
Expand Down Expand Up @@ -198,7 +198,7 @@ RegistryBuilder.<ConnectionSocketFactory> create()
.register("https", sslConnectionSocketFactory)
.build();

final BasicHttpClientConnectionManager sslConnectionManager = new BasicHttpClientConnectionManager(sslSocketFactoryRegistry);
final PoolingHttpClientConnectionManager sslConnectionManager = new PoolingHttpClientConnectionManager(sslSocketFactoryRegistry);

HttpClientBuilder httpClientBuilder = HttpClients.custom().setConnectionManager(sslConnectionManager);
CloseableHttpClient httpClient = httpClientBuilder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
import org.apache.hc.client5.http.impl.classic.HttpClients;
import org.apache.hc.client5.http.impl.io.BasicHttpClientConnectionManager;
import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager;
import org.apache.hc.client5.http.io.HttpClientConnectionManager;
import org.apache.hc.client5.http.socket.ConnectionSocketFactory;
import org.apache.hc.client5.http.ssl.NoopHostnameVerifier;
Expand Down Expand Up @@ -111,7 +111,7 @@ RegistryBuilder.<ConnectionSocketFactory> create()
.register("https", sslConnectionSocketFactory)
.build();

return new BasicHttpClientConnectionManager(sslSocketFactoryRegistry);
return new PoolingHttpClientConnectionManager(sslSocketFactoryRegistry);
}

public static RestTemplate restTemplateWithMtls()
Expand Down

0 comments on commit 07cd158

Please sign in to comment.