-
Notifications
You must be signed in to change notification settings - Fork 220
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
Introduce to Reactive Messaging and Reactive Streams ? #20
Comments
Hi thanks for your advice, we may consider providing reactive APIs in openmessaging, but we need more research and discussions. |
@bsideup Do you have any suggestion for reactive API style, I think it is a high-levelAPI base on our core API now. |
@vongosling I don't think that the reactive APIs can be efficiently implemented on top of the APIs you have atm. Reactive style has a concept of a dynamic "demand" known upfront. |
We may consider integrating RSocket to OpenMessaging. What do you say? |
@harrycodawang RSocket fits incredibly well into this story and I already had a very successful experience integrating it into an event gateway: |
@bsideup @harrycodawang very glad that we could pick up the topic about Reactive Streams :-) RSocket may not be an API level, I am not sure what's your point about here.Also, I have talked about with the micro-profile team from the Eclipse Foundation, who have tried a little bit in here, We could try to define and keep discussing. |
@vongosling RSocket alone may not be, but RSocket RPC provides gRPC-like APIs (also defined as Protobuf services) with the back-pressure support and other nice features |
@bsideup Do you any thoughts that can be illustrated by some charts how RSocket can be integrated to OpenMessaging? Thanks for referring to the project liiklus, could you please help share some illustration about the system architecture with RSocket, liiklus and Event Brokers? One of the questions in my head is that "Does it mean two network connections i.e. a RSocket connection plus a Broker Client/Server connection? Or we can use RSocket to implement the Broker Client/Server protocol, since as you said, reactive APIs have the most expressive foundation to implement all the APIs " |
I do, I can draft a simple RSocket RPC example for the OpenMessaging API
An RSocket connection is sufficient to cover the Broker Client/Server protocol.
Ok, I'll add it to Liiklus' description to help understand it better. |
|
@harrycodawang Currently, it looks like this:
(Where
So, even if the Event Systems will support RSocket, Liiklus will stay (although dramatically simplified on the "event store plugin" part, visualized on the diagram on the right side). |
I think we could combine the issue to address how to support reactive programming paradigms. I've seen a lot of guys(Microprofile Reactive Streams, Spring Reactor, RSocket, Akka Streams, JDK8&JDK9, RxJava and so on.) work hard in this area but none of them is fittable for messaging. So, It's really worth exploring. After all, building an API like this was not our original intention. |
@vesense we can keep talking about it in this thread:-) |
Thanks a lot for your illustration. I have 2 thoughts about the RSocket and Message system.
|
@bsideup Could you tell me why do you prefer to support push model. once we adopt it, back pressure must be taken seriously.
@harrycodawang It is eay to support backpressure in Reactive gateway,such as onBackpressureError,onBackpressureLatest,onBackpressureDrop and onBackpressureBuffer. But it seems to no meaning for messaging backpressure in producer/publisher. |
@bsideup @harrycodawang Do we have any further discussion for reactive messaging :-)
Actually speaking, I am not sure which is standard API, There currently exist two Reactive Streams APIs. The first is provided by http://www.reactive-streams.org/, and lives in the org.reactivestreams package. The second is provided by JDK9, and lives as inner interfaces of the java.util.concurrent.Flow class. Both APIs are identical in everything but namespace. But what's the solution if we could broader our language except java? |
It looks like consider from Java application developer side, JDK9 Flow class should be the most effortless API. @bsideup Do you know whether RSocket supports JDK9 reactive-stream API? |
Here I should have referred it more like a "push-pull" model, sorry.
The methods you mentioned are "reactions" to the back-pressure, not the "support".
While RSocket does support 4 different styles (fire & forget, request/response, stream, and bi-directional), you don't have to implement all of them. They share the same RSocket (think channel) and you can start multiple requests on the same RSocket.
Flow is indeed a port of reactive-streams spec in the JDK, with the exactly same semantics. All reactive libraries on JVM support reactive-streams, some provide adapters for the Flow API (i.e. Project Reactor does, and RSocket uses Project Reactor inside)
The reactive spec is language agnostic and shares the same semantics between implementations
Actually, it is the least effortless :D See my previous comment + there are a lot of Java 8 users who can't use Java 9+ yet. |
any update ? |
Hi!
Given the rising popularity of reactive APIs (also the Flow API in Java 9), such initiative as OpenMessaging should provide the first-class APIs for the reactive world.
To define the "reactive":
I pre-checked some of the points I think already provided. So far
The proven beauty of reactive APIs is that you can easily convert them to pull/push/streaming APIs, but not the other way around.
That might serve a foundation for the underlying implementations, but it's important to have it as an API, not the detail of implementation.
The text was updated successfully, but these errors were encountered: