title: PoolingHttpClientConnectionManager not re-using existing Idle connection
body: <p>I am using Apache PoolingHttpClientConnectionManager to create a pool of conenctions. However I am seeing in the logs that the existing Idle connection is not used and rather it creates a new connection. Below is the code</p>
  
  <pre><code>PoolingHttpClientConnectionManager connManager = connManager = new PoolingHttpClientConnectionManager();
  connManager.setMaxTotal(4);
      connManager.setDefaultMaxPerRoute(4);
  
  //Creating CloseableHttpClient with a default keep alive of 2 minutes
      CloseableHttpClient  client = HttpClients.custom()
              .setConnectionManager(connManager)
              .setKeepAliveStrategy(new KeepAliveStrategy(keepAlive))
              .build();
  
  
  //Sending 1st request
  String xml="&lt;xml data&gt;";
  HttpPost post = new HttpPost("&lt;URL&gt;");
      HttpEntity entity = new ByteArrayEntity(xml.getBytes("UTF-8"));
      post.setEntity(entity);
      HttpResponse  response =client.execute(post);
      String result = EntityUtils.toString(response.getEntity());
      EntityUtils.consume(response.getEntity());
  </code></pre>
  
  <p>After the response is received the <strong>PoolStats</strong> says that <strong>Total Number of available Connection is 1</strong> .</p>
  
  <p>Now I again Fire the same request after 5 seconds and upon getting the response the <strong>PoolStats</strong> states that the <strong>Total Number of available Connection is 2</strong></p>
  
  <p>The below code is for <strong>PoolStats</strong></p>
  
  <pre><code> PoolStats stats = connManager.getTotalStats();
      System.out.println("Total Connections Available : "+stats.getAvailable());
  </code></pre>
  
  <blockquote>
    <p>My Question here is Since after the First Request-response there was already a Connection in the pool so why did it create one more connection. Why it did not use the existing conenction?</p>
  </blockquote>