这里的一个思考是,当下多语言大家真的觉得痛吗?可以参考Dapr社区目前的多语言问题。社区的小伙伴可以发表一下自己的意见。另外,我非常担心新协议的兼容性,当下社区发展还是非常快的,全世界范围内使用的人也非常多,希望能够看到平滑过度的更细致的方案。

HTTP3是未来的方向,也是目前尖端企业在研究跟进包括落地的方向,我也希望在proposal里看到这块的想法。

p.s 这个问题可以更开放一些,所以这里我用中文来回复。非常希望听到更多的来自社区朋友的反馈。

炼龙 <1936978...@qq.com> 于2021年6月10日周四 上午6:13写道:

> 能否像dubbo那样,除了实现一些常用的序列化,也用SPI,让用户可以自定义序列化?
>
>
>
> 发自我的iPhone
>
>
> ------------------ Original ------------------
> From: yukon <yu...@apache.org&gt;
> Date: Wed,Jun 9,2021 9:48 PM
> To: dev <dev@rocketmq.apache.org&gt;
> Subject: Re: RIP23: Support gRPC protocol
>
>
>
> +1 for this proposal.
>
> Obviously, supporting gRPC could make it easier for RocketMQ contributors
> to write multi-Language SDKs. Looking forward to more details of this
> proposal.
>
> Regards,
> yukon
>
> On Wed, Jun 9, 2021 at 11:10 AM Zhanhui Li <lizhan...@apache.org&gt;
> wrote:
>
> &gt; Hi,
> &gt; This proposal, in general, is in the right direction that helps
> RocketMQ
> &gt; provide full-fledged SDK for popular languages and platforms. Taking
> full
> &gt; advantage of gRPC does save a lot of effort in terms of serialization
> and
> &gt; RPC tiers. Obviously, this proposal also brings complexities and
> potential
> &gt; compatibility issues.
> &gt;
> &gt; One of the potential issues is that gRPC does not expose Channel in
> the
> &gt; implementation while RocketMQ processors make heavy use of it, even
> if both
> &gt; of them are built on top of Netty 4.x.&nbsp; Will this an issue when
> reuse
> &gt; existing code?
> &gt;
> &gt; Zhanhui Li
> &gt;
> &gt; On Tue, Jun 8, 2021 at 8:28 PM i yangkun <yangku...@outlook.com&gt;
> wrote:
> &gt;
> &gt; &gt; Background &amp; Motivation
> &gt; &gt; What do we need to do
> &gt; &gt;
> &gt; &gt;
> &gt; &gt;&nbsp;&nbsp; *&nbsp;&nbsp; Will we add a new module?
> &gt; &gt; maybe.
> &gt; &gt;&nbsp;&nbsp; *&nbsp;&nbsp; Will we add new APIs?
> &gt; &gt; Yes.
> &gt; &gt;
> &gt; &gt;&nbsp;&nbsp; *&nbsp;&nbsp; Will we add new feature?
> &gt; &gt; Yes.
> &gt; &gt;
> &gt; &gt;
> &gt; &gt; Why should we do that
> &gt; &gt;
> &gt; &gt;
> &gt; &gt;&nbsp;&nbsp; *&nbsp;&nbsp; Are there any problems of our current
> project?
> &gt; &gt;
> &gt; &gt; a. Remoting module is too complicated to maintain, gRPC makes it
> easier
> &gt; to
> &gt; &gt; establish a robust communication layer, the current remoting
> module would
> &gt; &gt; be simplified radically.
> &gt; &gt;
> &gt; &gt; b. gRPC has been the de-facto standard in CloudNative, service
> mesh would
> &gt; &gt; be easily applied if gRPC is enabled.
> &gt; &gt;
> &gt; &gt; c. The private protocol of RocketMQ depends on the FastJson, it
> is
> &gt; &gt; difficult to adapt for other language.
> &gt; &gt;
> &gt; &gt; On the other side, since the pop consumer has been merged, we
> could
> &gt; &gt; implement new SDK based on gRPC and pop, which is easier to
> develop and
> &gt; &gt; maintain.
> &gt; &gt;
> &gt; &gt; Chinese Version:
> &gt; &gt;
> &gt; &gt; a. Remoting 模块对于长期的维护而言过于复杂了,我们可以使用 gRPC 更轻松地建立起一个健壮的通信层,这会使得现有的
> remoting
> &gt; &gt; 模块从根本上得到简化。
> &gt; &gt;
> &gt; &gt; b. gRPC 目前已经是云原生时代的事实标准,使用 gRPC 可以使得我们天然获取一些云原生的能力,比如 Service
> Mesh。
> &gt; &gt;
> &gt; &gt; c. 目前 RocketMQ 的私有协议强烈依赖 FastJson,多语言的适配将会变得困难。
> &gt; &gt;
> &gt; &gt;
> &gt; &gt; 从另外一个角度来说,鉴于 pop 消费者已经被合并,我们可以基于 gRPC 和 pop 实现新的 SDK,新的 SDK
> 将会更加易于开发和维护。
> &gt; &gt;
> &gt; &gt; Goals
> &gt; &gt;
> &gt; &gt;
> &gt; &gt;&nbsp;&nbsp; *&nbsp;&nbsp; What problem is this proposal designed
> to solve?
> &gt; &gt;
> &gt; &gt; Support gRPC's protocol, simplify current communication layer oof
> &gt; &gt; RocketMQ, make it easier to adapt for other language, which is
> not
> &gt; limited
> &gt; &gt; to CPP/GO/C#/GO。
> &gt; &gt;
> &gt; &gt; Chinese Version:
> &gt; &gt;
> &gt; &gt; 支持 gRPC 协议,简化 RocketMQ 现有的通信层,复用 gRPC 的能力,简化多语言适配成本,不限于
> CPP/GO/C#/GO。
> &gt; &gt;
> &gt; &gt;&nbsp;&nbsp; *&nbsp;&nbsp; To what degree should we solve the
> problem?
> &gt; &gt; This RIP must guarantee below point:
> &gt; &gt;
> &gt; &gt;&nbsp;&nbsp; 1.&nbsp; Compatibility: Both of gRPC and
> RemotingCommand should be
> &gt; supported.
> &gt; &gt;&nbsp;&nbsp; 2.&nbsp; High performance: This implementation does
> not affects latency and
> &gt; &gt; throughput.
> &gt; &gt;
> &gt; &gt;
> &gt; &gt; Chinese Version:
> &gt; &gt;
> &gt; &gt; 新方案需要保证两点:
> &gt; &gt;
> &gt; &gt;&nbsp;&nbsp; 1.&nbsp; 兼容性:同时支持 gRPC 和 RemotingCommand 协议,不影响现有功能。
> &gt; &gt;&nbsp;&nbsp; 2.&nbsp; 高性能:基于 gRPC 的实现不影响整理的延时和吞吐量。
> &gt; &gt;
> &gt; &gt;
> &gt; &gt; Non-Goals
> &gt; &gt;
> &gt; &gt;
> &gt; &gt;&nbsp;&nbsp; *&nbsp;&nbsp; What problem is this proposal NOT
> designed to solve?
> &gt; &gt; Nothing specific.
> &gt; &gt;&nbsp;&nbsp; *&nbsp;&nbsp; Are there any limits of this proposal?
> &gt; &gt; Nothing specific.
> &gt; &gt;
> &gt; &gt;
> &gt; &gt; Changes
> &gt; &gt; Architecture
> &gt; &gt;
> &gt; &gt;
> &gt; &gt; Current broker processor and client.
> &gt; &gt;
> &gt; &gt; [
> &gt; &gt;
> &gt;
> https://intranetproxy.alipay.com/skylark/lark/0/2021/png/200096/1623142547507-128b85f5-98f4-4568-85f8-28ef32982b7c.png
> &gt; &gt; ]
> &gt; &gt;
> &gt; &gt; Proposed gRPC processor and client.
> &gt; &gt;
> &gt; &gt; [
> &gt; &gt;
> &gt;
> https://intranetproxy.alipay.com/skylark/lark/0/2021/png/200096/1623142552491-a7f58ac0-cd7d-4ddd-936e-fb296b667196.png
> &gt; &gt; ]
> &gt; &gt;
> &gt; &gt; Broker would provide a protocol negotiate procedure to
> distinguish
> &gt; &gt; RemotingCommand from gRPC protocol. two kinds or processor in
> broker
> &gt; would
> &gt; &gt; re-use the same port to serve for RPC from different SDK.
> &gt; &gt;
> &gt; &gt;
> &gt; &gt; Chinese Version:
> &gt; &gt;
> &gt; &gt; broker 本身提供协议协商机制用于区分 RemotingCommnad 和 gRPC 协议,broker 针对 gRPC 和
> &gt; &gt; RemotingCommand 提供不同的 processor 为各自的 SDK 服务。
> &gt; &gt;
> &gt; &gt; Interface Design/Change
> &gt; &gt;
> &gt; &gt;
> &gt; &gt;&nbsp;&nbsp; *&nbsp;&nbsp; Method signature changes
> &gt; &gt; Nothing specific.
> &gt; &gt;&nbsp;&nbsp; *&nbsp;&nbsp; Method behavior changes
> &gt; &gt; Nothing specific.
> &gt; &gt;
> &gt; &gt;&nbsp;&nbsp; *&nbsp;&nbsp; CLI command changes
> &gt; &gt; Nothing specific.
> &gt; &gt;&nbsp;&nbsp; *&nbsp;&nbsp; Log format or content changes
> &gt; &gt; Nothing specific.
> &gt; &gt;
> &gt; &gt;
> &gt; &gt; Compatibility, Deprecation, and Migration Plan
> &gt; &gt;
> &gt; &gt;
> &gt; &gt;&nbsp;&nbsp; *&nbsp;&nbsp; Are backward and forward compatibility
> taken into consideration?
> &gt; &gt;
> &gt; &gt; Broker support processor of RemotingCommand and gRPC
> simultaneously, so
> &gt; &gt; there are one compatibility situations:
> &gt; &gt;
> &gt; &gt; If user migrates from original SDK to gRPC SDK in push mode, the
> &gt; &gt; re-balance policy should make sure that it would not cause
> repeated
> &gt; &gt; consumption for a lot of messages.
> &gt; &gt;
> &gt; &gt;&nbsp;&nbsp; *&nbsp;&nbsp; Are there deprecated APIs?
> &gt; &gt; Nothing specific.
> &gt; &gt;&nbsp;&nbsp; *&nbsp;&nbsp; How do we do migration?
> &gt; &gt; Nothing specific.
> &gt; &gt;
> &gt; &gt;
> &gt; &gt; Implementation Outline
> &gt; &gt;
> &gt; &gt;
> &gt; &gt; We will implement the proposed changes by 4 phases.
> &gt; &gt;
> &gt; &gt;
> &gt; &gt; Phase 1
> &gt; &gt;
> &gt; &gt;&nbsp;&nbsp; 1.&nbsp; Provides gRPC protocol definition(IDL)
> &gt; &gt;
> &gt; &gt; Phase 2
> &gt; &gt;
> &gt; &gt;&nbsp;&nbsp; 1.&nbsp; Implement gRPC processor of broker.
> &gt; &gt;&nbsp;&nbsp; 2.&nbsp; Implement protocol negotiation of two kinds
> of protocol(gRPC and
> &gt; &gt; RemotingCommand)
> &gt; &gt;
> &gt; &gt; Phase 3
> &gt; &gt;
> &gt; &gt;&nbsp;&nbsp; 1.&nbsp; Implement new JAVA and CPP native SDK based
> on gRPC
> &gt; &gt;
> &gt; &gt; Phase 4
> &gt; &gt;
> &gt; &gt;&nbsp;&nbsp; 1.&nbsp; Implement native SDK base on gRPC for other
> language.
> &gt; &gt;
> &gt; &gt;
> &gt; &gt; Rejected Alternatives
> &gt; &gt;
> &gt; &gt;
> &gt; &gt; How does alternatives solve the issue you proposed?
> &gt; &gt;
> &gt; &gt;
> &gt; &gt; Thrift? not so much impact as gRPC in community.
> &gt; &gt;
> &gt; &gt;
> &gt; &gt; Pros and Cons of alternatives
> &gt; &gt;
> &gt; &gt;
> &gt; &gt; Nothing specific.
> &gt; &gt;
> &gt; &gt; Why should we reject above alternatives
> &gt; &gt;
> &gt; &gt;
> &gt;



-- 
Best Regards :-)

Reply via email to