Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-1557

Offer request body as Publisher<byte[]>

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • API
    • None
    • Medium
    • Hide
      It is now possible to use Reactive Streams to read and write the message bodies of requests and responses. This uses reactive-streams.org as opposed to Java 9 Flow to allow pre-Java9 users to continue to use Undertow. Adapters to bridge between reactive-streams.org and Java9 are available in the reactive-streams.org reactive-streams-flow-adapters.
      Show
      It is now possible to use Reactive Streams to read and write the message bodies of requests and responses. This uses reactive-streams.org as opposed to Java 9 Flow to allow pre-Java9 users to continue to use Undertow. Adapters to bridge between reactive-streams.org and Java9 are available in the reactive-streams.org reactive-streams-flow-adapters.

      Undertow offers Channels as a form of async communication to the application. Channels are non blocking and allow Undertow to scale very nicely. However, they are quite fiddly to work with from an application developer's perspective. It is often preferable to use a Publisher/Subscriber system.

      Java 9 has this available in the Flow library but integrating this would require all users to migrate to use Java9. Instead, it would be a good idea to use org.reactivestreams.Publisher for retrieving the request body and org.reactivestreams.Subscriber for writing to response bodies.

      Implementing this would add a dependency onto at least reactivestreams. It the Undertow doesn't want to roll its own Publisher, it's possible to use rxjava2's Flowable/Observable or reactive's Flux.

            flaviarnn Flavia Rainone
            ehiggs Ewan Higgs (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: