You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by la...@apache.org on 2021/10/09 12:55:13 UTC
[dubbo-go] branch 3.0 updated: fix: change service name from nacos
instance service name to app name (#1508)
This is an automated email from the ASF dual-hosted git repository.
laurence pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git
The following commit(s) were added to refs/heads/3.0 by this push:
new c22d9c3 fix: change service name from nacos instance service name to app name (#1508)
c22d9c3 is described below
commit c22d9c3e529f05cfd5bfc064ff93bf423db39886
Author: Laurence <45...@users.noreply.github.com>
AuthorDate: Sat Oct 9 20:55:08 2021 +0800
fix: change service name from nacos instance service name to app name (#1508)
---
registry/nacos/service_discovery.go | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/registry/nacos/service_discovery.go b/registry/nacos/service_discovery.go
index b820eb8..68bcb6f 100644
--- a/registry/nacos/service_discovery.go
+++ b/registry/nacos/service_discovery.go
@@ -160,8 +160,10 @@ func (n *nacosServiceDiscovery) GetInstances(serviceName string) []registry.Serv
delete(metadata, idKey)
res = append(res, ®istry.DefaultServiceInstance{
- ID: id,
- ServiceName: ins.ServiceName,
+ ID: id,
+ // ins.ServiceName is nacos service name like 'DEFAULT_GROUP@@MyAppName",
+ // which is not the service name we wanted, so we use serviceName directly.
+ ServiceName: serviceName,
Host: ins.Ip,
Port: int(ins.Port),
Enable: ins.Enable,