feng996 opened a new issue #9322:
URL: https://github.com/apache/dubbo/issues/9322


   <!-- If you need to report a security issue please visit 
https://github.com/apache/dubbo/security/policy -->
   
   - [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) 
of this repository and believe that this is not a duplicate.
   
   ### Environment
   
   * Dubbo version: 3.0.4
   * Operating System version: Ubuntu 18.04
   * Java version: 11
   
   ### Steps to reproduce this issue
   
   consumer引用多注册中心的provider,只有一个provider能使用
   
debug发现,其他的reference在设置serviceUrls时(ServiceInstancesChangedListener#onEvent)拿不到MetadataInfo
   多配置中心没有生效。实际MetadataReportInstance只持有一个MetadataReport。
   
   通过MetadataReportInstance#init发现
   ```
    if (!init.compareAndSet(false, true)) {
               return;
    }
   ```
   只会init一次
   为什么会这么设计呢?
   
   ```
   DefaultApplicationDeployer#startMetadataCenter里关于配置中心的设置
   
   for (MetadataReportConfig metadataReportConfig : metadataReportConfigs) {
               
ConfigValidationUtils.validateMetadataConfig(metadataReportConfig);
               if (!metadataReportConfig.isValid()) {
                   logger.info("Ignore invalid metadata-report config: " + 
metadataReportConfig);
                   continue;
               }
               metadataReportInstance.init(metadataReportConfig);
    }
   ```
   
   


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