alibaba / spring-cloud-alibaba

Spring Cloud Alibaba provides a one-stop solution for application development for the distributed solutions of Alibaba middleware.

Home Page:https://sca.aliyun.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature] RocketMQ client SDK adapt

ruansheng8 opened this issue · comments

相关组件
RocketMQ

背景说明

Apache RocketMQ 5.0 版本发布后,客户端 SDK 提供了 gRPC 协议的支持,以前版本均采用 Remoting 协议。

  • Remoting 协议
    RocketMQ 早期组件间默认的通信协议, 是 RocketMQ 官方仓库中自带的实现
  • gRPC 协议
    5.0 版本以后开始支持, 旨在以云原生主流技术演进更加轻量、标准、易扩展的客户端服务端通信协议.

组件适配

SCA 将对两个不同版本的客户端 SDK 进行适配,由用户根据使用的 RocketMQ 服务端版本来自行选择客户端 SDK。

选型问题建议

以下章节列出一些场景场景下,推荐的选型策略。官网说明

  • 服务端版本是4.x版本,是否可以使用gRPC SDK ?

不支持,gRPC SDK 仅支持版本大于等于5.0的服务端,建议先平滑升级服务端到5.0再更换SDK。

  • 从 Remoting SDK 更换到 gRPC SDK 是否需要修改代码?

需要,gRPC SDK 重新优化设计了客户端API,和Remoting SDK API 并不兼容,因此需要对照修改代码。

  • 新业务使用 RocketMQ 推荐使用什么SDK?

全新的业务系统接入 RocketMQ,推荐使用gRPC SDK,可以获得更好的使用体验和多语言环境支持。


Background

After the release of Apache RocketMQ 5.0, the client SDK provides support for the gRPC protocol, while previous versions used the Remoting protocol.

  • Remoting Protocol
    The default communication protocol between components in early versions of RocketMQ, implemented in the official RocketMQ repository.
  • gRPC Protocol
    Supported since version 5.0, aiming to provide a lightweight, standard, and easily scalable client-server communication protocol using cloud-native mainstream technologies.

Component Adapt

SCA will adapt two different versions of the client SDK, and users can choose the client SDK based on the version of RocketMQ server they are using.

FAQ

The following sections list some recommended selection strategies for certain scenarios.Official Site

  • Can gRPC SDK be used with a server version of 4.x?
    No, gRPC SDK is only supported by server versions equal to or greater than 5.0. It is recommended to first smoothly upgrade the server to version 5.0 and then replace the SDK.

  • Is it necessary to modify the code when switching from Remoting SDK to gRPC SDK?
    Yes, it is necessary. The client API of gRPC SDK has been redesigned and is not compatible with the Remoting SDK API. Therefore, it is necessary to modify the code accordingly.

  • What's the best choice of sdk when use rocketmq in new system?
    If a new business system is integrating with RocketMQ, it is recommended to use gRPC SDK, as it provides a better user experience and support for multiple language environments.

Has anyone completed this quest yet? If not, I would like to try to complete this quest, is that ok?

Has anyone completed this quest yet? If not, I would like to try to complete this quest, is that ok?

@yuyu1025 Welcome to contribute

This issue has been open 30 days with no activity. This will be closed in 7 days.

This issue has been automatically marked as stale because it hasn't had any recent activity.If you think this should still be open, or the problem still persists, just pop a reply in the comments and one of the maintainers will (try!) to follow up. Thank you for your interest and contribution to the Sping Cloud Alibaba Community.