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

CachingHttpAsyncClient does not follow same pattern as Caching HttpClient

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 5.0 Alpha3
    • None

    Description

      I would have expected the Caching version of the HttpAsyncClient library to following same pattern as the non async version. In the non-async version, we have a CachingHttpClientBuilder class which extends the HttpClientBuilder, and they both end up returning the same client implementation: CloseableHttpClient.

      I would have expected the same from the async version. Instead it uses CachingHttpAsyncClient as a decorator approach.

      This is unfortunate, because i really want to be able to not care about the implementation and do this:

      CloseableHttpAysncClient client = clientFactory.create("test");

      But i cannot do this, due to the design. I also considered this:

      HttpAysncClient client = clientFactory.create("test");

      But this does not guarantee that it implements Closeable, and in fact, CachingHttpAsyncClient does not implement that interface.

      I'd like to see it more in line with the synchronous version.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mattinger Matthew P. Inger
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: