1

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 2

5

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.

2
  • sorry for late reply. the answer was really helpful. Thanks. Sep 2, 2021 at 3:53
  • 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
1

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

  1. request & response
  2. fire & forget
  3. request & streaming
  4. 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.