From f0a71b7eb05daba6b1ec016b86ea821638520782 Mon Sep 17 00:00:00 2001 From: chengyouling Date: Sat, 24 Dec 2022 09:14:32 +0800 Subject: [PATCH] update --- .../dubbo/registry/service/NacosRegistryServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sermant-plugins/sermant-service-registry/dubbo-registry-service/src/main/java/com/huawei/dubbo/registry/service/NacosRegistryServiceImpl.java b/sermant-plugins/sermant-service-registry/dubbo-registry-service/src/main/java/com/huawei/dubbo/registry/service/NacosRegistryServiceImpl.java index f092809baf..1779c44ce5 100644 --- a/sermant-plugins/sermant-service-registry/dubbo-registry-service/src/main/java/com/huawei/dubbo/registry/service/NacosRegistryServiceImpl.java +++ b/sermant-plugins/sermant-service-registry/dubbo-registry-service/src/main/java/com/huawei/dubbo/registry/service/NacosRegistryServiceImpl.java @@ -20,6 +20,7 @@ import com.huawei.dubbo.registry.entity.NacosServiceName; import com.huawei.dubbo.registry.listener.NacosAggregateListener; import com.huawei.dubbo.registry.service.nacos.NacosRegistryService; +import com.huawei.dubbo.registry.utils.CollectionUtils; import com.huawei.dubbo.registry.utils.NacosInstanceManageUtil; import com.huawei.dubbo.registry.utils.NamingServiceUtils; import com.huawei.dubbo.registry.utils.ReflectUtils; @@ -260,7 +261,9 @@ private Instance createInstance(Object url) { if (serviceMeta != null) { metaData.put(SERVICE_META_VERSION, serviceMeta.getVersion()); metaData.put(SERVICE_META_ZONE, serviceMeta.getZone()); - metaData.putAll(serviceMeta.getParameters()); + if (!CollectionUtils.isEmpty(serviceMeta.getParameters())) { + metaData.putAll(serviceMeta.getParameters()); + } } Instance instance = new Instance(); instance.setIp(ReflectUtils.getHost(url));