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

Support reactive publishers at the HttpClientEngine level

    XMLWordPrintable

    Details

    • Type: Feature Request
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 4.7.0.Final
    • Component/s: None
    • Labels:
      None

      Description

      Currently, the HttpClientEngine supports blocking and non-blocking responses.  The latter is done via `CompletableFuture`.  One implementation of this is `ReactorNettyHttpClientEngine`.   This coupled with the `MonoRxInvoker` allows our customers to write things like this:

      webTarget.path("/foo").get().rx(MonoRxInvoker.class).map(...).subscribe()
       

      in order to achieve non-blocking HTTP client calls.  The `MonoRxInvoker` implementation converts a `CompletionStage` to a `Mono`.  This works well; however, there are some other reactor-features that we can leverage if the engine returned a `Publisher`.  They include:

      • The ability for a `Mono#timeout` set on the response to aggressively terminate the HTTP request.
      • The ability to pass a (reactor) context from client calls into reactor-based HttpClientEngines.
      • Some `CompletionStage` threading issues are avoided.  This affects us because we have some unfortunate usage of `ThreadLocal` which are very difficult to remove.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ron_sigal Ronald Sigal
              Reporter:
              crankydillo1 Samuel Cox
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: