diff --git a/src/main/java/com/marklogic/rest/util/RestTemplateUtil.java b/src/main/java/com/marklogic/rest/util/RestTemplateUtil.java index e77219fe6..e85519ee8 100644 --- a/src/main/java/com/marklogic/rest/util/RestTemplateUtil.java +++ b/src/main/java/com/marklogic/rest/util/RestTemplateUtil.java @@ -6,6 +6,7 @@ import org.apache.http.conn.ssl.SSLContextBuilder; import org.apache.http.conn.ssl.TrustStrategy; import org.apache.http.conn.ssl.X509HostnameVerifier; +import org.apache.http.impl.NoConnectionReuseStrategy; import org.apache.http.impl.client.BasicCredentialsProvider; import org.apache.http.impl.client.HttpClientBuilder; import org.slf4j.Logger; @@ -58,6 +59,7 @@ public static RestTemplate newRestTemplate(RestConfig config) { httpClientBuilder.setHostnameVerifier(config.getHostnameVerifier()); } + httpClientBuilder.setConnectionReuseStrategy(new NoConnectionReuseStrategy()); HttpClient client = httpClientBuilder.build(); RestTemplate rt = new RestTemplate(new HttpComponentsClientHttpRequestFactory(client));