Alanxtl opened a new pull request, #3360:
URL: https://github.com/apache/dubbo-go/pull/3360

   ### Description
   
   这个pr删了synthesizer相关的逻辑
   
   1. synthesizer相关的逻辑根本就没有被使用
   2. synthesizer相关的逻辑只有rest协议实现了
   
   现在真正生效的是:
   
   `service instance -> metadata service -> MetadataInfo.Services -> 
instance.ToURLs(serviceInfo)`
   
   也就是用 provider 暴露出来的 `ServiceInfo` 重建 URL。
   
   而 synthesizer 这边目前主要是 REST 有一个实现:根据订阅 URL 和实例地址拼:
   
   ```text
   rest://host:port/interface
   ```
   
   但它拿不到 provider 真实导出的很多参数。更关键的是,我在当前代码里没看到 `GetAllSynthesizer()` 
被服务发现主流程调用;也就是说它至少不是现在这条链路的核心。
   
   所以可以这么定性:
   
   **正常路径不该用 synthesizer。**  
   有 metadata 时,metadata 才是权威来源。
   
   **synthesizer 最多是 fallback。**  
   比如老 provider 没 metadata、metadata 拉取失败,但协议又能安全地从实例地址推导 URL,这时可以临时合一个。
   
   **REST synthesizer 特别鸡肋。**  
   REST 调用真正关键的是 path/query/header/body 映射,而这些 synthesizer 
推不出来。它最多能补地址,不能补完整语义。你现在样例能跑,是因为 consumer 本地有 REST config,不是 synthesizer 多聪明。
   
   
   ### Checklist
   - [x] I confirm the target branch is `develop`
   - [x] Code has passed local testing
   - [x] I have added tests that prove my fix is effective or that my feature 
works
   


-- 
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]

Reply via email to