From a60d7a58267b1d6a37ae2df741be5e7f2849bdd6 Mon Sep 17 00:00:00 2001 From: bruce <841326226@qq.com> Date: Tue, 8 Oct 2019 15:19:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dnacos=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E8=AE=BE=E7=BD=AEweight=3D1.0,=E5=AF=BC=E8=87=B4=E6=9D=83?= =?UTF-8?q?=E9=87=8D=E8=8E=B7=E5=8F=96bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/alibaba/dubbo/registry/nacos/NacosRegistry.java | 1 + .../com/alibaba/dubbo/registry/nacos/NacosRegistryFactory.java | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/dubbo-registry/dubbo-registry-nacos/src/main/java/com/alibaba/dubbo/registry/nacos/NacosRegistry.java b/dubbo-registry/dubbo-registry-nacos/src/main/java/com/alibaba/dubbo/registry/nacos/NacosRegistry.java index 20ce09acbec..06fced89256 100644 --- a/dubbo-registry/dubbo-registry-nacos/src/main/java/com/alibaba/dubbo/registry/nacos/NacosRegistry.java +++ b/dubbo-registry/dubbo-registry-nacos/src/main/java/com/alibaba/dubbo/registry/nacos/NacosRegistry.java @@ -433,6 +433,7 @@ private Instance createInstance(URL url) { Instance instance = new Instance(); instance.setIp(ip); instance.setPort(port); + instance.setWeight(newURL.getParameter(Constants.WEIGHT_KEY, Constants.DEFAULT_WEIGHT)); instance.setMetadata(new HashMap(newURL.getParameters())); return instance; } diff --git a/dubbo-registry/dubbo-registry-nacos/src/main/java/com/alibaba/dubbo/registry/nacos/NacosRegistryFactory.java b/dubbo-registry/dubbo-registry-nacos/src/main/java/com/alibaba/dubbo/registry/nacos/NacosRegistryFactory.java index 56de76076d4..6bc26cf1a16 100644 --- a/dubbo-registry/dubbo-registry-nacos/src/main/java/com/alibaba/dubbo/registry/nacos/NacosRegistryFactory.java +++ b/dubbo-registry/dubbo-registry-nacos/src/main/java/com/alibaba/dubbo/registry/nacos/NacosRegistryFactory.java @@ -93,7 +93,6 @@ private void setProperties(URL url, Properties properties) { putPropertyIfAbsent(url, properties, NAMESPACE); putPropertyIfAbsent(url, properties, NACOS_NAMING_LOG_NAME); putPropertyIfAbsent(url, properties, ENDPOINT); - putPropertyIfAbsent(url, properties, NAMESPACE); putPropertyIfAbsent(url, properties, ACCESS_KEY); putPropertyIfAbsent(url, properties, SECRET_KEY); putPropertyIfAbsent(url, properties, CLUSTER_NAME);