You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/08/05 13:02:09 UTC

[GitHub] [dubbo-go] zhaoyunxing92 commented on a change in pull request #1353: Ftr: Support Custom Registry GroupName on Nacos

zhaoyunxing92 commented on a change in pull request #1353:
URL: https://github.com/apache/dubbo-go/pull/1353#discussion_r683408838



##########
File path: registry/nacos/registry.go
##########
@@ -109,14 +109,16 @@ func createRegisterParam(url *common.URL, serviceName string) vo.RegisterInstanc
 		Healthy:     true,
 		Ephemeral:   true,
 		ServiceName: serviceName,
+		GroupName:   groupName,
 	}
 	return instance
 }
 
 // Register will register the service @url to its nacos registry center
 func (nr *nacosRegistry) Register(url *common.URL) error {
 	serviceName := getServiceName(url)
-	param := createRegisterParam(url, serviceName)
+	groupName := nr.URL.GetParam(constant.GROUP_KEY, "")

Review comment:
       虽然nacos默认使用`DEFAULT_GROUP`group,但是我还是感觉应该需要手动指定下
   
   ```go
   instance := vo.RegisterInstanceParam{
   		Ip:          url.Ip,
   		Port:        uint64(port),
   		Metadata:    params,
   		Weight:      1,
   		Enable:      true,
   		Healthy:     true,
   		Ephemeral:   true,
   		ServiceName: serviceName,
   		GroupName:   url.GetParam(constant.GROUP_KEY, defaultGroup),
   	}
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org