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

Proper handling of ClientHttpEngine configuration

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Done
    • Major
    • 4.4.0.Final
    • 4.3.1.Final
    • None
    • None

    Description

      For Quarkus we're using a different ClientHttpEngine for when SSL is disabled, to prevent issues with native image generation. So in RestClientBuilderImpl it does:

              if (!SSL_ENABLED) {
                  resteasyClientBuilder.httpEngine(new URLConnectionEngine());
                  resteasyClientBuilder.sslContext(null);
                  resteasyClientBuilder.trustStore(null);
                  resteasyClientBuilder.keyStore(null, "");
              }
      

      However, I've just realized that this means that connect and read timeouts, and possibly other configuration is not being properly set.

      As RestClientBuilderImpl does:

              if (readTimeout != null) {
                  resteasyClientBuilder.readTimeout(readTimeout, readTimeoutUnit);
              }
              if (connectTimeout != null) {
                  resteasyClientBuilder.connectTimeout(connectTimeout, connectTimeoutUnit);
              }
      

      inside the ResteasyClientBuilder it doesn't then set those values on the ClientHttpEngine because the engine already exists.

      So, I'm not really sure the most appropriate way to fix this.

      Some options I can think of are:

      1. RestClientBuilderImpl constructs the URLConnectionEngine setting the appropriate timeouts, etc before setting it into the builder
      2. A ClientHttpEngineBuilder is created for URLConnectionEngine, and then ResteasyClientBuilderImpl looks for a marker of some kind to indicate which engine builder to use. Or maybe it's a method on the builder to explicitly set the builder, but then it defaults to ClientHttpEngineBuilder43

      There might be other alternatives as well

      Attachments

        Issue Links

          Activity

            People

              kfinniga@redhat.com Ken Finnigan (Inactive)
              kfinniga@redhat.com Ken Finnigan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: