提交 8d0dd7a5 编写于 作者: L liangfei0201

DUBBO-470 zookeeper注册中心添加empty协议条件错误

上级 74c59db3
......@@ -263,10 +263,11 @@ public class ZookeeperRegistry extends FailbackRegistry {
private List<URL> toUrlsWithEmpty(URL consumer, String path, List<String> providers) {
List<URL> urls = toUrlsWithoutEmpty(consumer, providers);
if (urls != null && urls.isEmpty()) {
if (urls == null || urls.isEmpty()) {
int i = path.lastIndexOf('/');
String category = i < 0 ? path : path.substring(i + 1);
urls.add(URL.valueOf(Constants.EMPTY_PROTOCOL + "://0.0.0.0/" + consumer.getServiceInterface() + "?" + Constants.CATEGORY_KEY + "=" + category));
URL empty = consumer.setProtocol(Constants.EMPTY_PROTOCOL).addParameter(Constants.CATEGORY_KEY, category);
urls.add(empty);
}
return urls;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册