sanxun0325 commented on a change in pull request #1633:
URL: https://github.com/apache/dubbo-go/pull/1633#discussion_r794258830



##########
File path: remoting/nacos/builder.go
##########
@@ -39,15 +39,17 @@ import (
        "dubbo.apache.org/dubbo-go/v3/config"
 )
 
-const nacosClientName = "nacos-client"
-
 // NewNacosConfigClientByUrl read the config from url and build an instance
 func NewNacosConfigClientByUrl(url *common.URL) 
(*nacosClient.NacosConfigClient, error) {
        sc, cc, err := GetNacosConfig(url)
        if err != nil {
                return nil, err
        }
-       return nacosClient.NewNacosConfigClient(nacosClientName, true, sc, cc)
+       clientName := url.GetParam(constant.ClientNameKey, "")

Review comment:
       按照这个pr的实现理论上应该都可以在url获取到clientName,如果没有获取到是不是默认生成一下nameID更好,不抛出错误。

##########
File path: config/config_center_config.go
##########
@@ -69,6 +69,11 @@ func (CenterConfig) Prefix() string {
        return constant.ConfigCenterPrefix
 }
 
+// NameId unique identifier id for client
+func (c *CenterConfig) NameId() string {

Review comment:
       NameId func 好几个文件都有实现,可以提取到一个公共函数中么,接收实现的Prefix的interface就好




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to