Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jaxrs-dev] SSE support and JDK9 Flow aka Reactive Streams

Hi all,

Today I noticed that JAX-RS will support SSE, and when I looked into it, I found that originally it was intended that a JDK9 Flow like API was used, but it was removed:

http://download.oracle.com/javaee-archive/jax-rs-spec.java.net/users/2017/04/4279.html

The reasoning behind that decision all sounds sensible to me, I'm not emailing to discuss that.

However, for those that were involved in the effort, I would be very much interested in some feedback on work around JDK9 Flow that we (as in myself and my company, Lightbend) have been doing. This work may have an impact on any future decision to adopt a Flow based API in JAX-RS.

The first is Reactive Streams servlet support:

https://github.com/jroper/reactive-streams-servlet

Above is a TCK verified implementation of Reactive Streams on top of the Servlet 3.1 asynchronous IO spec. Such an API could be a foundation for Flow support in JAX-RS, not just for SSE but for other uses as well, such as exposing raw request/response bodies as an asynchronous stream to developers. At the moment it sits as an adapter on top of the Servlet spec, but we think it would be better if the servlet spec (once JDK9 is the baseline supported JDK version) supported it natively, which would allow much more efficient implementations by vendors.

The second thing that we'd like feedback on is a Reactive Streams utility library, targeting inclusion in the JDK, inspired by the JDK8 Streams API but for building Reactive Streams graphs:

https://github.com/lightbend/reactive-streams-utils

Such an API in the JDK would allow end users to work nicely with a Flow-enabled SSE feature, allowing transforms like filter/map to be applied. Not only that, but such a library could also be used by vendors to help implement a Flow-enabled SSE feature, on top of the Reactive Streams servlet support mentioned above.

If you do have any feedback, you could either provide it here on this mailing list, or join in the discussions on core-libs-dev (for the JDK API at least):

http://mail.openjdk.java.net/pipermail/core-libs-dev/2018-March/051799.html

Regards,

James

--
James Roper
Senior Octonaut

Lightbend – Build reactive apps!
Twitter: @jroper


Back to the top