RSocket is a binary, reactive, message-driven protocol designed for efficient, bidirectional communication between networked applications especially microservices and streaming systems.
RSocket was created (by Netflix, Facebook, and others) to provide a reactive-streams–compliant transport that fixes those issues.
RSocket = Reactive Streams + Framing Protocol
It’s built on top of the Reactive Streams specification, which defines how to handle asynchronous data streams with backpressure.
Core idea:
Instead of “send and forget,” communication is modeled as a stream that can be:
- Requested (
request(n)), - Canceled,
- Or flowed in both directions.
So both peers are symmetrical each can be a client or a server at any moment.
Frame-Based Protocol (Binary Layer)
RSocket is binary and frame-oriented, not text-based like HTTP.
Each message (frame) contains:
| Field | Meaning |
|---|---|
| Stream ID | Which logical stream this message belongs to |
| Frame Type | REQUEST_RESPONSE, PAYLOAD, KEEPALIVE, etc. |
| Flags | Metadata, completion, next frame indicators |
| Payload | Data + optional metadata |
Because of framing, multiple logical streams can share one TCP or WebSocket connection.
| Feature | Meaning |
|---|---|
| Reactive Streams | Every data exchange is a stream; the receiver explicitly controls how many items to receive. |
| Frame-based | Communication is broken into binary frames (messages) tagged with stream IDs. |
| Multiplexed | Many logical streams share one TCP or WebSocket connection. |
| Transport-agnostic | Can run on TCP, WebSocket, HTTP/2, Aeron, etc. |
| Symmetric | Both sides can initiate requests — no strict “client/server.” |