Similarityoung opened a new issue, #918: URL: https://github.com/apache/dubbo-go-pixiu/issues/918
### ✅ 验证清单 - [x] 🔍 我已经搜索过 [现有 Issues](https://github.com/apache/dubbo-go-pixiu/issues),确信这不是重复问题 ### 📦 Dubbo-go-pixiu 版本 latest ### 客户端配置 _No response_ ### 协议配置 _No response_ ### 注册中心配置 _No response_ ### 💬 您的问题 ## 背景 最近在整理 `dubbo-go-pixiu-samples` 的集成测试时发现,`dubbogo/simple/triple` 原本不是泛化调用,而是 HTTP JSON 请求到 protobuf/IDL typed Triple provider 的调用: - HTTP body 是普通 JSON:`{"name":"test"}` - provider 方法是 typed protobuf 签名:`SayHello(ctx, *HelloRequest) (*User, error)` - 该链路依赖 IDL/protobuf 语义,而不是 Dubbo generic invoke 的 `types/values` 语义 当前我们已经把 `dubbogo/simple/triple` 改成了真正的 Triple 泛化调用: - Triple 协议仍然使用 `tri` - serialization 改为 `hessian2` - HTTP body 使用 `{"types":"string","values":"test"}` - 运行时日志显示 `generic=true`、`IDL-mode=non-IDL` 这说明当前 HTTP -> Dubbo/Triple 动态网关链路可以通过 Dubbo-go GenericService 覆盖 Triple 泛化调用,不需要 IDL。 当前主链路是: ``` HTTP request -> dgp.filter.http.dubboproxy -> pkg/filter/http/remote.DubboHandler -> pkg/client/dubbo -> dubbo-go GenericService.Invoke ``` ## 问题 我们需要明确:Pixiu 当前是否还需要维护一条 IDL-based Triple invocation 能力? 这里的 IDL 调用指的是: ``` HTTP JSON -> 根据 .proto / protoset / reflection 找到 protobuf message descriptor -> 将 JSON marshal/unmarshal 成 protobuf message -> 调用 typed Triple/gRPC backend ``` 它不同于当前已经跑通的 Triple 泛化调用: ``` HTTP JSON {"types": "...", "values": ...} -> Dubbo GenericService.Invoke -> tri + hessian2 + non-IDL generic ``` 我认为如果是 IDL typed Triple 调用,网关本身没有必要实现这层能力。 IDL 形式的调用本质上已经有明确的服务契约:客户端和服务端都基于 `.proto` 生成代码,知道 service、method、request message、response message 的结构。这类调用天然应该由业务客户端或标准 Triple/gRPC 客户端直接完成,网关在中间重新解析 proto、构造 protobuf message、再转发 typed 调用,价值并不明显。 相比之下,网关更适合解决的是“调用方没有强类型 SDK、需要通过 HTTP 动态访问 Dubbo 服务”的场景,也就是泛化调用。泛化调用需要网关根据 `types/values`、interface、method、group、version 等运行时信息去完成协议转换和服务发现,这才是 `dgp.filter.http.dubboproxy` 应该承担的职责。 如果我们让网关支持 IDL typed Triple,会引入额外复杂度: - 网关必须管理 `.proto` / protoset / reflection 来源; - 网关必须处理 protobuf JSON 与二进制 message 的编解码; - 网关需要维护 descriptor 缓存、版本匹配和错误处理; - `requestType: triple` 会同时表示 generic Triple 和 typed IDL Triple,语义变复杂; 所以我的判断是:如果调用已经是 IDL 形式,就应该直接使用 Triple/gRPC typed client,不需要 Pixiu 在 HTTP Dubbo proxy 里再实现一套 IDL 调用。Pixiu 在这里应聚焦于 Triple 泛化调用,也就是 `tri + hessian2 + generic=true + non-IDL` 这条链路。 ### 📚 背景信息 _No response_ ### 🔗 相关资源 _No response_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
