试用
RSocket是一个基于Reactive Streams的网络协议,它可以在异步、多路复用、全双工的网络连接中传输数据。
RSocket通讯模型如下:
- Request-Response:传统RPC
- Fire-and-Forget:消息发送
- Request-Stream:消息订阅
- Request-Channel:双向通讯,如Chat
此外RSocket还提供Metadata-Push(元数据推送),可以实现一下管控操作。
个人是Alibaba RSocket Broker作者,对RSocket颇有研究,小型项目我会采用,但是大型项目,考虑到团队和Reactive的学习门槛等, 还是使用诸如REST API,GraphQL, gRPC, Dubbo等。个人采用,大家可以试用。
RSocket & Friends
- Alibaba RSocket Broker: https://alibroker.info/
- Spring RSocket: https://docs.spring.io/spring-framework/reference/rsocket.html
- rsocket-kotlin: https://github.com/rsocket/rsocket-kotlin
- kotlinx.rpc: https://github.com/Kotlin/kotlinx-rpc
References
- RSocket: https://rsocket.io/
- RSocket by Example: http://rsocketbyexample.com/