Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 59c6d41

Browse files
Dermot SmythDermot Smyth
authored andcommitted
#244: Issues with http manage client connection sharing - disabled connection sharing
1 parent b7eb082 commit 59c6d41

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/java/com/marklogic/rest/util/RestTemplateUtil.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import org.apache.http.conn.ssl.SSLContextBuilder;
77
import org.apache.http.conn.ssl.TrustStrategy;
88
import org.apache.http.conn.ssl.X509HostnameVerifier;
9+
import org.apache.http.impl.NoConnectionReuseStrategy;
910
import org.apache.http.impl.client.BasicCredentialsProvider;
1011
import org.apache.http.impl.client.HttpClientBuilder;
1112
import org.slf4j.Logger;
@@ -58,6 +59,7 @@ public static RestTemplate newRestTemplate(RestConfig config) {
5859
httpClientBuilder.setHostnameVerifier(config.getHostnameVerifier());
5960
}
6061

62+
httpClientBuilder.setConnectionReuseStrategy(new NoConnectionReuseStrategy());
6163
HttpClient client = httpClientBuilder.build();
6264

6365
RestTemplate rt = new RestTemplate(new HttpComponentsClientHttpRequestFactory(client));

0 commit comments

Comments
 (0)