-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a Reactive Stream as an extension #232
Comments
This is a similar situation as #203. While it seems fine for JNoSQL to use a MicroProfile library in an implementation, it is not acceptable for the Spec/API (Jakarta NoSQL) |
And do not forget the Java 9 Flow API, it should be supported, like Spring Data, as an addon of the ReactiveStreams spec, which can be converted between different ReactiveStreams impls. |
@otaviojava Did you look at https://spring.io/projects/spring-data-r2dbc? As for which API you are going to support, I think supporting Java 9 Flow is better than org.reactivestreams APIs. However, you can use the Reactive Streams RxJava, Reactor, Akka for implementations. Adopting MicroProfile Reactive Streams Operators is a great idea as well. |
@Emily-Jiang |
@otaviojava I do not think it is conflict when adopting Java 9 Flow APIs. We can handle it like Spring Data, support ReactiveStreams spec/Microprofile ReactiveStreams Operators which are Java 8 based, and add addons to support Java 9 Flow, Reactor, RxJava 1/2/3, SmallRye Munity, etc. |
@hantsy That sounds like a good plan :) |
@otaviojava/all, please don't forget, that the final NoSQL release won't even be relevant to the Jakarta EE platform before Jakarta EE 10, so it is more than reasonable to consider adopting to Jakarta EE 9 now. Which is based on Java SE 9 or even 11, therefore all those reactive technologies could be fine, particularly for the implementation, as long as they are usable by Eclipse projects. |
@keilw Eclipse MicroProfile uses interfaces, that means we can use Flow as implementation.
|
What do you think about this Eclipse MicroProfile project? |
@otaviojava I think it is a good idea to adopt MicroProfile Reactive Streams Operators even though in the future the APIs might change. I will be interested in any feedback you might have. |
@Emily-Jiang @otaviojava Note, that Jakarta EE has stronger compatibility requirements, therefore a frequently changing API is no good. Let's wait till MicroProfile becomes more mature and especially for the API it can't be used until there is a resolution by the various committees following such committee or WG on the MP side, a current version of MP Reactive Streams can't be used. Isn't SmallRye just one implementation? Jakarta NoSQL and JNoSQL should work with all Jakarta EE compatible runtimes and implementations. As mentioned there is no RI for MP either, but compared to the other two Lightbend implementations it seems that SmallRye is a little more up do date and better-maintained. Also the number of dependencies looks fewer, so it could be a good option, but we'd have to evaluate more carefully before making a decision. |
@keilw |
I think I would rather stick to something like https://github.com/reactive-streams/reactive-streams-jvm. "For this reason, the same interfaces provided by https://www.reactive-streams.org in the org.reactivestreams package are used instead." so MP Reactive does nothing more than use this library. If we want to use the nifty diagrams. then we may also consider using the MP project but similar to MP OpenAPI it is just a think layer or glue to another existing spec, so the spec or API it uses is of greater value here. |
But what does that mean for the PR, would it work now or only after adopting Java 11? |
@keilw it will work on both now and later with less impact to the users. |
Now Jakarta EE 10 is aligned to Java 11, I think it is time to add ReactiveStreams. I think using Java 9 Flow API is OK. (Java 11 HttpClient is a good example of using Flow API, eg. HttpResponse.BodySubscriber). There are some utilities in reactivestreams.org to convert between Flow and ReactiveStreams. And it seems SmallRye Mutiny is switching to use Flow API instead, smallrye/smallrye-mutiny#986 |
We'll close this idea for awhile. We'll focus on the Jakarta Data and NoSQL implementation. |
Goal
The goal of this proposal is to write an extension to each API that allows integration with Reactive Streams API.
Briefly, Reactive Stream is an initiative to provide a standard for asynchronous stream processing with non-blocking backpressure.
This extension will work integrated with the Eclipse MicroProfile Reactive Streams Operators.
About Reactive Streams
Reactive Streams is an integration SPI - it allows two different libraries that provide asynchronous streaming to be able to stream data to and from each other.
Reactive Streams is not however designed to be used directly by application developers. The semantics defined by Reactive Streams are very strict, and are nontrivial, particularly in the areas of thread safety, to implement correctly. Typically, application developers are expected to use third-party libraries that provide the tools necessary to manipulate and control streams. Examples include Akka Streams, RxJava, and Reactor.
Repository
The repositories programming model is the most high-level abstraction and we'll have a repository to handle with
ReactiveRepository
:Templates
Just as the traditional repositories are based on traditional template implementations, the reactive ones are built on top of a reactive template.
References:
The text was updated successfully, but these errors were encountered: