You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "lkj41110 (GitHub)" <gi...@apache.org> on 2020/01/17 04:06:48 UTC

[GitHub] [dubbo] lkj41110 commented on issue #5617: [dubbo-5322]When using zookeeper and ConfigCenterConfig is null,don't set port attribute.

> `org.apache.dubbo.common.config.configcenter.AbstractDynamicConfigurationFactory#getDynamicConfiguration` does not read `port` when create a configcenter. It is better to overwrite `port` in `address` when update `address` or read `address`.

从我的理解看`org.apache.dubbo.common.config.configcenter.AbstractDynamicConfigurationFactory#getDynamicConfiguration`入参是`URL`,然后从`URL`里拿出address。`URL`里的address是包含port的。

出现#5322里的问题是因为从`configCenter`获取URL这一步有问题,之前的设计中`configCenter`是没有port的概念。
```
DynamicConfiguration dynamicConfiguration = getDynamicConfiguration(configCenter.toUrl());
```
所以我的修改是参考`RegistryConfig `的做法增加了一个port的属性,且在setAdress的时候对port参数等参数进行了覆盖

[ Full content available at: https://github.com/apache/dubbo/pull/5617 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org