Harry33t opened a new issue, #1081:
URL: https://github.com/apache/dubbo-go-samples/issues/1081

   ## 问题描述
   
   我在本地测试 config_center/zookeeper sample 时,发现 README 中展示的 server 
配置端口与实际代码中的端口不一致。
   
   README 中的配置示例是:
   ```
   protocols:
     triple:
       name: tri
       port: 20000
   ```
   但是 go-server/cmd/main.go 中的配置字符串实际使用的是:
   ```
   protocols:
     triple:
       name: tri
       port: 50000
   ``` 
   实测 server 也确实监听在 50000 端口。
   
   这会导致用户阅读 README 时误以为该 sample 使用的是 20000 端口,从而产生困惑;如果用户基于 README 手动配置 
client/server,也可能出现连接失败。
   
   
   ## 复现步骤
   ```
   启动 Zookeeper:
   docker run -d --name zk -p 2181:2181 zookeeper:3.8
   启动 server:
   go run ./config_center/zookeeper/go-server/cmd/main.go
   启动 client:
   go run ./config_center/zookeeper/go-client/cmd/main.go
   ``` 
   
   ### 实际结果
   sample 可以正常跑通,client 输出类似:
   ```
   Server response:
   greeting:"Hello, this is dubbo go server! I received: Hello, this is dubbo 
go client!"
   ``` 
   但是 README 中展示的端口是 20000,而代码实际使用的是 50000。
   
   ### 预期结果
   
   README 中的端口说明应与代码保持一致。
   比方将,如果代码继续使用 50000,README 中对应配置也应该改为:
   ```
   protocols:
     triple:
       name: tri
       port: 50000
   ```
   ## 建议修复方式
   建议统一 README 和代码中的端口配置。
   更推荐直接修正 README,将示例端口从:
   port: 20000
   修改为:
   port: 50000
   这样可以避免用户根据文档理解 sample 时产生误导。
   
   ## 影响:
   这是文档与代码不一致的问题。虽然默认运行 sample 时可以跑通,但会影响用户理解配置中心示例的实际行为,也可能导致用户手动调整配置时连接到错误端口。
   如果这个修复方向可以接受,我可以继续提交 PR。


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