From 6a45acb4f58270dcd228ff56b1e4988c892f5586 Mon Sep 17 00:00:00 2001 From: Albumen Kevin Date: Mon, 1 Jun 2020 17:49:57 +0800 Subject: [PATCH] fix(registry-nacos):fix nacos service name associated with group name (#6227) --- .../dubbo/registry/nacos/util/NacosNamingServiceUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/util/NacosNamingServiceUtils.java b/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/util/NacosNamingServiceUtils.java index 5644474f148..789adeefaad 100644 --- a/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/util/NacosNamingServiceUtils.java +++ b/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/util/NacosNamingServiceUtils.java @@ -27,6 +27,7 @@ import com.alibaba.nacos.api.exception.NacosException; import com.alibaba.nacos.api.naming.NamingService; import com.alibaba.nacos.api.naming.pojo.Instance; +import com.alibaba.nacos.api.naming.utils.NamingUtils; import java.util.Properties; @@ -90,7 +91,7 @@ public static Instance toInstance(ServiceInstance serviceInstance) { */ public static ServiceInstance toServiceInstance(Instance instance) { DefaultServiceInstance serviceInstance = new DefaultServiceInstance(instance.getInstanceId(), - instance.getServiceName(), instance.getIp(), instance.getPort()); + NamingUtils.getServiceName(instance.getServiceName()), instance.getIp(), instance.getPort()); serviceInstance.setMetadata(instance.getMetadata()); serviceInstance.setEnabled(instance.isEnabled()); serviceInstance.setHealthy(instance.isHealthy());