title: Spring Boot Rest Template - CloseableHttpClient
body: <p>I am defining a bean of type CloseableHttpClient in my Spring boot app. But still I get the error that the bean could not be found.</p>
  
  <pre><code>@Bean
  @Primary
  public RestTemplate restTemplate(RestTemplateBuilder builder, @Qualifier("pooledClient") CloseableHttpClient httpClient) {
      return builder.requestFactory(new HttpComponentsClientHttpRequestFactory(httpClient)).build();
  }
  
  @Bean
  public CloseableHttpClient httpClient() {
      return HttpClientBuilder.create().build();
  }
  </code></pre>
  
  <p>Parameter 1 of method restTemplate in com.MyConfiguration required a bean of type 'org.apache.http.impl.client.CloseableHttpClient' that could not be found.</p>
  
  <p>Action:</p>
  
  <p>Consider defining a bean of type 'org.apache.http.impl.client.CloseableHttpClient' in your configuration.</p>