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

Triple non-proto mode support #2491

Open
chickenlj opened this issue Nov 8, 2023 · 1 comment
Open

Triple non-proto mode support #2491

chickenlj opened this issue Nov 8, 2023 · 1 comment
Milestone

Comments

@chickenlj
Copy link
Contributor

triple协议非proto模式的支持,比如一个是

  • 完全无proto
  • 一个是client侧无proto
@chickenlj
Copy link
Contributor Author

chickenlj commented Nov 20, 2023

无 proto 场景

server

  1. 如何注册服务?
server.Register(handler, opts...)
// 反射生成 ServiceInfo,并最终进入当前proto模式: Register(handler, serviceInfo, opts...)
  1. 使用什么序列化?

由 client 端的配置决定,server侧也可以设置默认配置;主推是 json?其实应该是什么格式都能支持

client

  1. 怎么发起调用?
genericService := client.NewGenericService(ctx, interfaceName, refOpts)
genericService.Call(ctx, {req, &resp}, methodName, callOpts)

// 或者

client.Call(ctx, {req, &resp}, interfaceName, methodName, refOpts, callOpts)

发起调用的类型,通过 CallOption.WithContentType() 区分(映射到 Serialization 类型):

  • 全部不使用 proto - 强约束必须 request/response 参数模式,不支持多参数
    • client 侧有 struct 强类型,application/json
    • client 侧无 struct 类型,application/generic+json
  • 使用 proto
    • client 侧无 proto,application/protoc+json
    • client 侧无 proto,基于 server reflection,用户输入json链路传输proto binary
  1. 和之前的 dubbo2+hessian 模式有什么区别?和之前 Generic 泛化调用的区别?
    • 在 go 体系下,之前的泛化调用继续存在,但是废弃;
    • 与 java 互通的话,3.2 版本开始推荐用其他模式
      • triple+idl 标准模式,要求是java从开始就是idl写的
      • 如果开始是java模式写的,则发布rest服务互通,需要 dubbo-go 支持 rest 模式的服务调用与发布。
      • 如果是 java 3.3 版本及以下,走 generic 繁华调用模式

以上所有场景,考虑如何通过 cli 插件在编码/编译期做一些事情,以简化用户开发

@chickenlj chickenlj added this to the v3.2.0-rc2 milestone Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant