Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-1192

How to use Resteasy with Closeable apache httpclient

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 3.0.10.Final, 3.6.3.Final
    • jaxrs
    • Documentation (Ref Guide, User Guide, etc.)

      User guide is missing description how to use Resteasy with Closeable apache httpclient.
      The use case here is, that resteasy-client created with
      Client client = ClientBuilder.newClient();

      And this client throws TimeOutException, client is then not able to invoke any other requests to the server.
      The solution can be to create own apache Closeable httpclient and pass it to ResteasyClientBuilder:

      CloseableHttpClient httpClient = HttpClientBuilder.create()
                      .setDefaultRequestConfig(reqConfig)
                      .build();
      
      Client client = ResteasyClientBuilder().httpEngine(new ApacheHttpClient4Engine(httpClient, true)).build();  // RESTEasy specific
      

      This infomartion should be probably placed together within this chapter:
      http://docs.jboss.org/resteasy/docs/3.0.9.Final/userguide/html_single/index.html#transport_layer

              rsigal@redhat.com Ronald Sigal
              kanovotn Katerina Odabasi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: