I have created CloseableHttpClient object as shown below. I am trying to understand when will the destroy method in HttpComponentsClientHttpRequestFactory class be called? I tried debugging by terminating the application but the destory() method is not called when the application is terminated.
CloseableHttpClient client = HttpClientBuilder.create().setSSLSocketFactory(csf).setDefaultRequestConfig(config).build();
return new HttpComponentsClientHttpRequestFactory(client);