This is an automated email from the ASF dual-hosted git repository.
tswstarplanet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/master by this push:
new 683db2b fix issue 6568, remove unnecessary parameter in registry
cache key when cache NacosRegistry (#6571)
683db2b is described below
commit 683db2b1b2e2af0bb7718005f54d74d8000cf41f
Author: tswstarplanet
AuthorDate: Tue Aug 11 09:03:18 2020 +0800
fix issue 6568, remove unnecessary parameter in registry cache key when
cache NacosRegistry (#6571)
---
.../java/org/apache/dubbo/registry/nacos/NacosRegistryFactory.java | 7 +++
1 file changed, 7 insertions(+)
diff --git
a/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistryFactory.java
b/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistryFactory.java
index 380280e..a51b65b 100644
---
a/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistryFactory.java
+++
b/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistryFactory.java
@@ -17,10 +17,12 @@
package org.apache.dubbo.registry.nacos;
import org.apache.dubbo.common.URL;
+import org.apache.dubbo.common.utils.StringUtils;
import org.apache.dubbo.registry.Registry;
import org.apache.dubbo.registry.RegistryFactory;
import org.apache.dubbo.registry.support.AbstractRegistryFactory;
+import static
org.apache.dubbo.common.constants.CommonConstants.CONFIG_NAMESPACE_KEY;
import static
org.apache.dubbo.registry.nacos.util.NacosNamingServiceUtils.createNamingService;
/**
@@ -32,6 +34,11 @@ public class NacosRegistryFactory extends
AbstractRegistryFactory {
@Override
protected String createRegistryCacheKey(URL url) {
+String namespace = url.getParameter(CONFIG_NAMESPACE_KEY);
+url = URL.valueOf(url.toServiceStringWithoutResolving());
+if (StringUtils.isNotEmpty(namespace)) {
+url = url.addParameter(CONFIG_NAMESPACE_KEY, namespace);
+}
return url.toFullString();
}