is have been studying rsocket and reactive programming for a while and quite often spring webflux is mentioned i wanted to ask whats the difference between the rsocket and spring webflux or are they same things.Thanks
2 Answers
RSocket (https://rsocket.io) provides a protocol for Reactive Streams semantics between client-server, and server-server communication. It allows you to use Flow (Flux), or a single response (Mono) over a network with various semantics and bidirectionally.
Spring Webflow (https://spring.io/projects/spring-webflow) is a way to build a webapp with reactive stream semantics for non blocking operations.
Typically you might combine these, such as your backend connecting to other services using RSocket, or you might choose for some clients (e.g. Javscript running in the browser) to talk to the server using RSocket over WebSockets for streaming events.
-
-
The thing is I wanted to use Rsokect for voice and video call in my app and for file streaming. The app uses spring boot in backend and flutter on front. so what is your suggestion. Thanks. Sep 2, 2021 at 3:55
There are some major differences between the two.
Webflux supports HTTP request-response
RSocket is a protocol (Uses TCP/Websocket) for reactive streams it supports below
- request & response
- fire & forget
- request & streaming
- Bi Directional streaming
Another major difference is that in Webflux the data is transferred as JSON but in RSocket it is transferred as Binary.
In short, RSocket is more advanced, faster, has more modes and supports Reactive Stream programming better. The downside to it compared to Webflux is the lack of tools to test.