Open bsideup opened 4 years ago
Rsocket Core Dev here! I can help with anything that is needed from the RSocket side!
Thanks for creating this issue, @bsideup! +1 for having RSocket support, as well as WebSocket. We will need to figure out:
Hi @trustin!
And thank you soo much for your enthusiasm and openness for RSocket! I really appreciate that!
In general, RSocket frames have a pretty strict format, thus I guess it is possible to distinguish them checking layout. However, that approach can not be stable since reading the full frame to check its layout all the time (if it would be necessary for all the frames) can be expensive.
On the other hand, RSocket can work on top of WebSocket. That said, WebSocket can be mapped on some specific path of the HTTP server, so this can be used as an alternative to avoid frames checking all the way.
I didn't look in detail but it seems rsocket can work with HTTP/2 streams
https://rsocket.io/docs/Protocol#framing
In that case it seems like it would be quite easy to provide support in Armeria :) Is there no content type sent with HTTP/2? If not, is it possible to add it? I think that would address the negotiation issue perfectly.
@anuraaga I'm planning on adding http/2 support for 1.1, but it is not there yet
@OlegDokuka Ah saw it in the docs but I guess that means the protocol is defined, but not implemented yet.
I guess it's a race between Armeria implementing web socket support and rsocket implementing HTTP/2? :) Or perhaps even Armeria could be the first implementation of rsocket over http/2.
What is necessary to implement is the Transport API. The core logic is shared and is transport agnostic
This is a meta issue for the https://rsocket.io support. RSocket is a binary protocol for use on byte stream transports such as TCP, WebSockets, and Aeron. It enables all modern communication models (request/response, request/stream, fire-and-forget, bi-directional streaming) without being tied to a concrete transport.
Unlike gRPC, it uses various transport options, but the TCP and WebSockets ones would be fitting Armeria very well and allow running it simultaneously with HTTP and gRPC on the same port (one of Ameria's greatest features if you ask me :))
For the RPC part, one can look at https://github.com/rsocket/rsocket-rpc-java - gRPC-like framework on top of RSocket.