Uploaded image for project: 'HttpComponents HttpClient'
  1. HttpComponents HttpClient
  2. HTTPCLIENT-2190

HttpClientBuilder does not configure correctly the HttpClientConnectionManager

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Invalid
    • 4.5.13
    • None
    • HttpClient (classic)
    • None

    Description

      The class HttpClientBuilder does not configure correctly the HttpClientConnectionManager properties "maxTotal" and "defaultMaxPerRoute" if I already provided a ConnectionManager.

      I sugest that the code on line 1000 should be put out of the "if" that tests if the "connManagerCopy" is null. Some think like this:

            if (connManagerCopy instanceof ConnPoolControl) {
                  ConnPoolControl<?> connPoolControl = (ConnPoolControl<?>) connManagerCopy;
                  if (systemProperties) {
                      String s = System.getProperty("http.keepAlive", "true");
                      if ("true".equalsIgnoreCase(s))

      {                     s = System.getProperty("http.maxConnections", "5");                     final int max = Integer.parseInt(s);                     connPoolControl.setDefaultMaxPerRoute(max);                     connPoolControl.setMaxTotal(2 * max);                 }

                  }
                  if (maxConnTotal > 0)

      {                 connPoolControl.setMaxTotal(maxConnTotal);             }

                  if (maxConnPerRoute > 0)

      {                 connPoolControl.setDefaultMaxPerRoute(maxConnPerRoute);             }

              }

      Attachments

        Activity

          People

            Unassigned Unassigned
            mbalieiro Marco Balieiro
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: