MoChengqian commented on issue #1009:
URL: 
https://github.com/apache/dubbo-go-samples/issues/1009#issuecomment-4074661376

   > 只是简单的使用示例是没有问题的,问题出现我现在需要使用的服务提供者是java dubbo 
2.x,使用dubbo-go3.0是可以正常调用rpc的,就是hessian2不支持java长类型,需要升级,一升级,对应的dubbo 
go也需要升级,之前试过dubbo go3.1.x也找不到服务提供者,再消费者里配置具体的url就可以了,表现上好像没有从zk上去获取服务提供者
   
   你好,你遇到的问题有两个原因:                                                              
                                                                                
                                 
                                                                                
                                                                                
                                           
     评论中’好像没有从zk上去获取服务提供者‘的原因:url 字段导致 ZK 完全被绕过                                 
                                                                                
                                                          
                     
     你的配置里同时有 url: 'dubbo://10.48.xx.xx:11090' 和 registries,框架内部逻辑是二选一:有 url 
就走直连,根本不会去读注册中心。这就是你说的"表现上好像没有从 ZK 上获取服务提供者"的真正原因,跟框架版本无关,任何版本都如此。解决方法:把 
reference 里的 url 字段删掉。
   
     而issue ‘dubbo-go 3.3.0 服务无法发现问题’的原因:version: '*' 通配符在 3.1.x/3.2.x 中匹配失败
   
     删掉 url 字段后走注册中心,3.1.x/3.2.x 确实存在一个bug:消费者订阅的 ServiceKey 是 
xxx.api.ILoginService:*,而 Java 
提供者注册的是xxx.api.ILoginService,字符串不相等导致提供者被静默过滤,zk上发现不了提供者,这时服务无法发现问题是存在的。解决方法:升级到
 v3.3.0,现在该 bug 已修复。
   
     两个原因都修正之后,你现有的 protocol: dubbo、registry-type: interface 配置完全正确,无需其他改动。
     issue 标题写的 "3.3.0" 应该是笔误,图中你实际使用版本是 3.2.0,不是3.3.0版本,3.3.0版本不会出现服务无法发现问题.


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