404008945 commented on issue #10393:
URL: https://github.com/apache/dubbo/issues/10393#issuecomment-1272335207

   > @huwenming-saw
   > 
   > > 还是会订阅一个空服务,这个空服务对应的接口还是同一个URL,这个时候难道就不会出现No provider available?
   > 
   > 这个取决于 nacos 是否会主动推空,这块取决于 nacos 的缓存与版本。2.7.17 及以后的版本在 Dubbo 侧做了过滤,防止空覆盖。
   > 
   > > 换另一个角度来说最好的解决方法还是需要提供group version值是最完美的解决方法是吗?
   > 
   > Dubbo 默认就是支持空 group、version 的,只是在实践中指定了 group、version 可以更好地实现服务管理。
   
   @AlbumenJ 今天看了2.7.17版本,看起来是将两种形式的url共用实例,只要其中一个url存在实例,那么都不会no 
Provider,但是测了一下还是有问题,**这里的serviceName是否应该为 event.serviceName**
   因为虽然分别订阅两种url,但是添加监听器使用的逻辑是使用的computeIfAbsent那么实际上两种url实际上共用了一个监听器
   ```java
    listeners.computeIfAbsent(listener, k -> {  ....................
   ```
   org.apache.dubbo.registry.nacos.NacosRegistry#subscribeEventListene
   
![image](https://user-images.githubusercontent.com/39762246/194712459-074ae201-7edf-40d3-b29c-328d89c20a8e.png)
   
   
这里因为两种url都公用一个监听器,而监听器的的变量serviceName方法入参传递过来,那么肯定只能是其中一个url,这样两种url服务的变化都反应到了这一个入参url,那么还是有可能会发生空覆盖
   


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