zhaoyunxing92 opened a new issue #1632:
URL: https://github.com/apache/dubbo-go/issues/1632


   <!-- Please only use this template for submitting enhancement requests -->
   
   **What would you like to be added**:
   
目前发现`RegistryConfig`、`MetadataReportConfig`、`CenterConfig`的`toURL`都有自己的`key`导致到具体实现的方法key获取的时候需要转换对应的key,处理起来比较容易出错
   ```go
   func newNacosRegistry(url *common.URL) (registry.Registry, error) {
        logger.Infof("[Nacos Registry] New nacos registry with url = %+v", 
url.ToMap())
        // key transfer: registry -> nacos
        url.SetParam(constant.NacosNamespaceID, 
url.GetParam(constant.RegistryNamespaceKey, ""))
        url.SetParam(constant.NacosUsername, url.Username)
        url.SetParam(constant.NacosPassword, url.Password)
        url.SetParam(constant.NacosAccessKey, 
url.GetParam(constant.RegistryAccessKey, ""))
        url.SetParam(constant.NacosSecretKey, 
url.GetParam(constant.RegistrySecretKey, ""))
        url.SetParam(constant.TimeoutKey, 
url.GetParam(constant.RegistryTimeoutKey, ""))
        url.SetParam(constant.NacosGroupKey, 
url.GetParam(constant.RegistryGroupKey, defaultGroup))
        namingClient, err := nacos.NewNacosClientByURL(url)
        if err != nil {
                return &nacosRegistry{}, err
        }
        tmpRegistry := &nacosRegistry{
                URL:          url, // registry.group is recorded at this url
                namingClient: namingClient,
                registryUrls: []*common.URL{},
        }
        return tmpRegistry, nil
   }
   ```
   在比如超时时间问题,CenterConfig使用的key是`constant.ConfigTimeoutKey`
   
![image](https://user-images.githubusercontent.com/18088210/144379640-8b9b3e0d-435c-43e9-8d5b-2686766f2166.png)
   
在`zk`里面使用的`constant.ConfigTimeoutKey`但是在`nacos`里面使用的却是`constant.TimeoutKey`,`etcd`里面用的又是`constant.ConfigTimeoutKey`
   **Why is this needed**:
   希望可以统一key,方便后面代码开发和阅读
   
   


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