This is an automated email from the ASF dual-hosted git repository.
liujun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git
The following commit(s) were added to refs/heads/master by this push:
new 585b3a5 Merge pull request #2887, fix consumer stub bug in multi
registries.
585b3a5 is described below
commit 585b3a5c4cee72dc0a597cef22bce83cd2df2d52
Author: Ian Luo <[email protected]>
AuthorDate: Thu Dec 6 17:48:19 2018 +0800
Merge pull request #2887, fix consumer stub bug in multi registries.
fixes #2850
---
.../apache/dubbo/rpc/cluster/directory/AbstractDirectory.java | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/directory/AbstractDirectory.java
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/directory/AbstractDirectory.java
index 0cea0b8..f650b6e 100644
---
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/directory/AbstractDirectory.java
+++
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/directory/AbstractDirectory.java
@@ -21,6 +21,7 @@ import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.extension.ExtensionLoader;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
+import org.apache.dubbo.common.utils.StringUtils;
import org.apache.dubbo.rpc.Invocation;
import org.apache.dubbo.rpc.Invoker;
import org.apache.dubbo.rpc.RpcException;
@@ -32,6 +33,7 @@ import
org.apache.dubbo.rpc.cluster.router.MockInvokersSelector;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import java.util.Map;
/**
* Abstract implementation of Directory: Invoker list returned from this
Directory's list method have been filtered by Routers
@@ -62,7 +64,14 @@ public abstract class AbstractDirectory<T> implements
Directory<T> {
if (url == null) {
throw new IllegalArgumentException("url == null");
}
- this.url = url;
+
+ if (url.getProtocol().equals(Constants.REGISTRY_PROTOCOL)) {
+ Map<String, String> queryMap =
StringUtils.parseQueryString(url.getParameterAndDecoded(Constants.REFER_KEY));
+ this.url =
url.clearParameters().addParameters(queryMap).removeParameter(Constants.MONITOR_KEY);
+ } else {
+ this.url = url;
+ }
+
this.consumerUrl = consumerUrl;
setRouters(routers);
}