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));