Skip to content

Commit

Permalink
Merge pull request #245 from derms/feature/issue-244-disable-manage-c…
Browse files Browse the repository at this point in the history
…lient-connection-sharing

#244: Issues with http manage client connection sharing - disabled connection sharing
  • Loading branch information
rjrudin authored Feb 15, 2018
2 parents b7eb082 + 59c6d41 commit d5e8f95
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/com/marklogic/rest/util/RestTemplateUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit d5e8f95

Please sign in to comment.