Skip to content

Instantly share code, notes, and snippets.

@umit
Created February 16, 2018 10:13
Show Gist options
  • Save umit/7b44a20c52741c0d82d33396f65dd022 to your computer and use it in GitHub Desktop.
Save umit/7b44a20c52741c0d82d33396f65dd022 to your computer and use it in GitHub Desktop.
public RestTemplate notificationCenterRestClient(Environment environment) {
CloseableHttpClient httpClient = HttpClients.custom().setSSLHostnameVerifier(new NoopHostnameVerifier()).build();
HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory();
requestFactory.setHttpClient(httpClient);
return new RestTemplateBuilder()
.interceptors(new RestTemplateCorrelationIdInterceptor(), new RestTemplateExecutorInterceptor(environment))
.requestFactory(requestFactory)
.build();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment