Skip to content

Commit

Permalink
use the correct spi ZookeeperTransporter when initialize the default …
Browse files Browse the repository at this point in the history
…ConfigCenter's zkClient(apache#4511)
  • Loading branch information
CodingSinger committed Jul 20, 2019
1 parent 9960d23 commit 7470936
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
import static org.apache.dubbo.registry.Constants.REGISTER_IP_KEY;
import static org.apache.dubbo.registry.Constants.REGISTER_KEY;
import static org.apache.dubbo.registry.Constants.SUBSCRIBE_KEY;
import static org.apache.dubbo.remoting.Constants.CLIENT_KEY;
import static org.apache.dubbo.remoting.Constants.DUBBO_VERSION_KEY;
import static org.apache.dubbo.rpc.Constants.INVOKER_LISTENER_KEY;
import static org.apache.dubbo.rpc.Constants.LOCAL_KEY;
Expand Down Expand Up @@ -619,8 +620,14 @@ private void useRegistryForConfigIfNecessary() {
Environment.getInstance().getDynamicConfiguration().orElseGet(() -> {
ConfigManager configManager = ConfigManager.getInstance();
ConfigCenterConfig cc = configManager.getConfigCenter().orElse(new ConfigCenterConfig());
cc.setParameters(new HashMap<>());
cc.getParameters().put(org.apache.dubbo.remoting.Constants.CLIENT_KEY,rc.getClient());
if (StringUtils.isNotEmpty(rc.getClient())) {
Map<String, String> parameters = cc.getParameters();
if (parameters == null) {
parameters = new HashMap<>();
cc.setParameters(parameters);
}
parameters.putIfAbsent(CLIENT_KEY, rc.getClient());
}
cc.setProtocol(rc.getProtocol());
cc.setAddress(rc.getAddress());
cc.setHighestPriority(false);
Expand Down

0 comments on commit 7470936

Please sign in to comment.