Reactive Programming with RSocket and Spring Boot
In this article, we’ll explore the RSocket protocol and its use with Spring Boot
6 min readAug 5, 2022
RSocket is an application protocol for multiplexed, duplex communication over TCP, WebSocket, and other byte stream transports such as Aeron. RSocket allows the following four communication models as shown in following figure 1:
In RSocket, once the initial handshake between the client and server is done, the “client” vs “server” distinction is lost as both sides can independently initiate one of the interactions as specified in figure 1.
The RSocket protocol has few key features and offers several benefits:
- Reactive Streams semantics for streaming requests interactions Request-Stream and Channel. Support for backpressure signal between requester and responder. This allows a requester to slow down a responder at the source. Thus, reduces reliance on network layer congestion control and network-level buffering
- Support for Request throttling to reduce the number of possible messages. This can be done after sending a
LEASE
frame to limit the total number of requests allowed by other ends for a given time - Fragmentation and re-assembly of large messages
- Keepalive through heartbeat…