Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To remove the "grpc" and "dubbo" generators from the "dubbo-compiler" project #13367

Closed
xiaoyuuuuuupeng opened this issue Nov 15, 2023 · 2 comments
Assignees
Labels
type/discussion Everything related with code discussion or question

Comments

@xiaoyuuuuuupeng
Copy link
Contributor

dubbo-compiler Purpose

The purpose of the dubbo-compiler is to generate certain capabilities for protocol conversion that cannot be accommodated within the dubbo framework, based on proto files.
all generators,you can see
WechatIMG24660

Changes

1. Remove the "grpc" package

Since the Tri protocol supports native gRPC calls and Tri clients can call native gRPC servers, the "grpc" package can be removed.

TODO:
Test scenarios:
Tri client to native gRPC server
Tri client to Tri server
gRPC client to Tri server

2. Remove the "dubbo" package?

The "dubbo" package contains two generators. Compare the code generated by both generators.
Untitled

The main difference is that DubboGenerator still uses ProtobufUtils from the dubbo-serialization package, which has some issues. The protobuf-java version in this package is tied to the dubbo version, which may cause compatibility issues if the locally generated code doesn't match this version. Additionally, this class has been removed in v3.3, so it can be safely removed.Dubbo3Generator provides support for dubbo to use proto-generated services for invocation, following an IDL development pattern. It is recommended to keep this generator.Note: The above translation assumes that "Tri" and "Dubbo" are specific terminologies or technologies related to the project. If they have different meanings or need to be translated differently, please provide more information for accurate translation.

@xiaoyuuuuuupeng xiaoyuuuuuupeng added the type/discussion Everything related with code discussion or question label Nov 15, 2023
@xiaoyuuuuuupeng
Copy link
Contributor Author

中文版本:

一、目的

dubbo-compiler目的是根据proto文件生成一部分无法承载在dubbo框架内部协议转换的能力。

二、改动

1、删除grpc包

Tri协议支持原生的grpc调用,支持Tri客户端调用原生的grpc-server,所以现可以将grpc包下的删掉。
该项目下的全部文件:
WechatIMG24660

TODO:

自测:

tri客户端→原生grpc

tri客户端→tri服务端

grpc→tri服务端

2、删除dubbo包?

dubbo包下有两个生成器,对比两者生成的代码

Untitled

主要区别在于DubboGenerator还在使用dubbo-serialization里面的ProtobufUtils,这个里面有大坑,这个包下的protobuf-java版本是跟dubbo版本走的,可能会导致你本地生成的代码和此版本不匹配,导致生成的代码报错。且此类也已经在v3.3被删除了,可以干掉此生成器没有问题。

Dubbo3Generator 提供了 dubbo对proto支持,支持dubbo使用proto生成Service进行调用,是一种IDL的开发模式支持,建议可以保留。

@AlbumenJ
Copy link
Member

Agree, we should make our code simple.

xiaoyuuuuuupeng pushed a commit to xiaoyuuuuuupeng/dubbo that referenced this issue Nov 23, 2023
AlbumenJ pushed a commit that referenced this issue Nov 29, 2023
…3409)

* feat:dubbo-compiler remove grpc and grpc/reactive package(#13367)

* feat:dubbo-complier only reserve dubbo3 and tri(#13367)

---------

Co-authored-by: pengxiaoyu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/discussion Everything related with code discussion or question
Projects
None yet
Development

No branches or pull requests

3 participants