Merge pull request #4663 from horizonzy/fix-4662
[ISSUE-#4662] Just choose one between nacosDomain mode and servers mode.
This commit is contained in:
commit
0732a93072
@ -119,7 +119,7 @@ public class NamingProxy implements Closeable {
|
||||
this.namespaceId = namespaceId;
|
||||
this.endpoint = endpoint;
|
||||
this.maxRetry = ConvertUtils.toInt(properties.getProperty(PropertyKeyConst.NAMING_REQUEST_DOMAIN_RETRY_COUNT,
|
||||
String.valueOf(UtilAndComs.REQUEST_DOMAIN_RETRY_COUNT)));
|
||||
String.valueOf(UtilAndComs.REQUEST_DOMAIN_RETRY_COUNT)));
|
||||
|
||||
if (StringUtils.isNotEmpty(serverList)) {
|
||||
this.serverList = Arrays.asList(serverList.split(","));
|
||||
@ -514,7 +514,7 @@ public class NamingProxy implements Closeable {
|
||||
|
||||
params.put(CommonParams.NAMESPACE_ID, getNamespaceId());
|
||||
|
||||
if (CollectionUtils.isEmpty(servers) && StringUtils.isEmpty(nacosDomain)) {
|
||||
if (CollectionUtils.isEmpty(servers) && StringUtils.isBlank(nacosDomain)) {
|
||||
throw new NacosException(NacosException.INVALID_PARAM, "no server available");
|
||||
}
|
||||
|
||||
@ -531,10 +531,7 @@ public class NamingProxy implements Closeable {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (servers != null && !servers.isEmpty()) {
|
||||
|
||||
} else {
|
||||
Random random = new Random(System.currentTimeMillis());
|
||||
int index = random.nextInt(servers.size());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user