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/11/08 11:10:45 UTC

[GitHub] [dubbo-go] Mulavar commented on a change in pull request #1565: register not use metadata configuration.

Mulavar commented on a change in pull request #1565:
URL: https://github.com/apache/dubbo-go/pull/1565#discussion_r744622690



##########
File path: registry/nacos/service_discovery.go
##########
@@ -330,22 +328,21 @@ func (n *nacosServiceDiscovery) String() string {
 }
 
 // newNacosServiceDiscovery will create new service discovery instance
-func newNacosServiceDiscovery() (registry.ServiceDiscovery, error) {
-	metadataReportConfig := config.GetMetadataReportConfg()
-	url := common.NewURLWithOptions(
-		common.WithParams(make(url.Values)),
-		common.WithPassword(metadataReportConfig.Password),
-		common.WithUsername(metadataReportConfig.Username),
-		common.WithParamsValue(constant.RegistryTimeoutKey, metadataReportConfig.Timeout))
-	url.Location = metadataReportConfig.Address
-	client, err := nacos.NewNacosClientByUrl(url)
+func newNacosServiceDiscovery(url *common.URL) (registry.ServiceDiscovery, error) {
+	discoveryUrl := common.NewURLWithOptions(
+		common.WithParams(url.GetParams()),
+		common.WithParamsValue(constant.NacosUsername, url.Username),
+		common.WithParamsValue(constant.NacosPassword, url.Password),
+		common.WithParamsValue(constant.NacosNamespaceID, url.GetParam(constant.NamespaceKey, "")))

Review comment:
       要不这个常量名直接改成 NacosNamespaceID,和前者统一一下?




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