sinfon opened a new issue, #2044:
URL: https://github.com/apache/dubbo-go/issues/2044

   定义两个 Nacos 注册中心配置 A 和 B,区别在于 A 的 registry-type 为 service
   
   定义 reference 使用 A,而定义 service 使用 B
   
   ---
   
   Dubbo 配置加载启动会按照 Consumer、Provider 的顺序
   
   ```
   rc.Consumer.Load()
   rc.Provider.Load()
   ```
   
   Consumer 加载时,会按照 `registryUrl.Location` 缓存一个 ServiceDiscoveryRegistry,而在这之后 
Provider 加载时,问题场景下,因为 `registryUrl.Location` 相同,会找到并使用这个 
registry.Registry,导致实际想要得到的 NacosRegistry 无法加载
   
   ```
   func (proto *registryProtocol) getRegistry(registryUrl *common.URL) 
registry.Registry {
           var err error
           reg, loaded := proto.registries.Load(registryUrl.Location)
           if !loaded {
                   reg, err = extension.GetRegistry(registryUrl.Protocol, 
registryUrl)
                   if err != nil {
                           logger.Errorf("Registry can not connect success, 
program is going to panic.Error message is %s", err.Error())
                           panic(err)
                   }
                   proto.registries.Store(registryUrl.Location, reg)
           }
           return reg.(registry.Registry)
   }
   ```
   


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