title: Custom RestTemplate using requestFactory of RestTemplateBuilder in SpringBoot 2.1.x is not backward compatible with version 1.5.x
body: <p>In <em><strong>Spring Boot 1.5.x</strong></em>, I was creating a custom <code>RestTemplate</code> like below:</p>
  <pre><code>@Bean
    public RestTemplate restTemplate(RestTemplateBuilder restTemplateBuilder) {
      PoolingHttpClientConnectionManager poolingConnectionManager = new PoolingHttpClientConnectionManager();
      poolingConnectionManager.setMaxTotal(restTemplateProps.getMaxConnectionsPerPool());
      poolingConnectionManager.setDefaultMaxPerRoute(restTemplateProps.getMaxDefaultConnectionPerRoute());
      CloseableHttpClient client = HttpClientBuilder.create().setConnectionManager(poolingConnectionManager).build();
      HttpComponentsClientHttpRequestFactory clientHttpRequestFactory =
          new HttpComponentsClientHttpRequestFactory(client);
      clientHttpRequestFactory.setConnectTimeout(restTemplateProps.getConnectionTimeout());
      clientHttpRequestFactory.setReadTimeout(restTemplateProps.getSocketTimeout());
      return restTemplateBuilder.requestFactory(clientHttpRequestFactory).build();
    }
  </code></pre>
  <p>But, after migrating to <em><strong>Spring Boot 2.1.x</strong></em>, the above code doesn't compile. Looks like <code>requestFactory</code> doesn't take <code>HttpComponentsClientHttpRequestFactory</code> as an input parameter.</p>
  <p>Can anyone suggest how can I make the above code work in Spring Boot 2.1.x?</p>