title: Spring RestTemplate - Need to release connection?
body: <p>This is my Configuration for Rest Template,</p>
  
  <pre><code>    @Bean
      @Qualifier("myRestService")
      public RestTemplate createRestTemplate(@Value("${connection.timeout}") String maxConn) {
          PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager();
           connectionManager.setMaxTotal(maxTotalConn);
           connectionManager.setDefaultMaxPerRoute(maxPerChannel);
  
          RequestConfig config = RequestConfig.custom().setConnectTimeout(100000).build();
          CloseableHttpClient httpClient = HttpClientBuilder.create().setConnectionManager(connectionManager)
                  .setDefaultRequestConfig(config).build();
          ClientHttpRequestFactory factory = new HttpComponentsClientHttpRequestFactory(httpClient);
  
          RestTemplate restTemplate = new RestTemplate(factory);
  
          restTemplate.setErrorHandler(new RestResponseErrorHandler());
           restTemplate.setMessageConverters(createMessageConverters());
  
          return restTemplate;
      }
  </code></pre>
  
  <p>Am using PoolingHttpClientConnectionManager for managing the connections. </p>
  
  <p>Its being accessed by the following code,</p>
  
  <pre><code>ResponseEntity&lt;String&gt; response = restClient.exchange( url, HttpMethod.GET, entity , String.class );
  </code></pre>
  
  <p>Do i need to release the connection after the above call or is it taken care by RestTemplate. If we need to take care of releasing connection. </p>
  
  <p>Please can some one explain/show how to release the connection.</p>