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/07/07 04:12:41 UTC

[GitHub] [dubbo] MorganYoung opened a new issue #8237: org.apache.dubbo.config.ConfigCenterConfig#setAddress 会将 username 覆盖为 null

MorganYoung opened a new issue #8237:
URL: https://github.com/apache/dubbo/issues/8237


   - [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
   - [ ] I have checked the [FAQ](https://github.com/apache/dubbo/blob/master/FAQ.md) of this repository and believe that this is not a duplicate.
   
   ### Environment
   
   * Dubbo version: 3.0.0
   
   
   ### Steps to reproduce this issue
   
   1. dubbo config-center 相关yml配置如下
   ```
   dubbo:
     ...
     config-center:
       address: nacos://xxxx:8848
       username: someusername
       password: xxxx
   ```
   
   2. 在执行 org.apache.dubbo.config.bootstrap.DubboBootstrap#startConfigCenter 方法时会调用 configCenterConfig.refresh(); 方法。
   3. setAddress方法,会覆盖已经设置过的username和password
   
   ```
   public void setAddress(String address) {
           this.address = address;
           if (address != null) {
               try {
                   URL url = URL.valueOf(address);
                   setUsername(url.getUsername());
                   setPassword(url.getPassword());
                   updateIdIfAbsent(url.getProtocol());
                   updateProtocolIfAbsent(url.getProtocol());
                   updatePortIfAbsent(url.getPort());
                   updateParameters(url.getParameters());
               } catch (Exception ignored) {
               }
           }
       }
   ```
   
   ### Expected Result
   
   希望设置前先判断是否已经设置过相关属性值
   
   
   


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


[GitHub] [dubbo] kylixs commented on issue #8237: org.apache.dubbo.config.ConfigCenterConfig#setAddress 会将 username 覆盖为 null

Posted by GitBox <gi...@apache.org>.
kylixs commented on issue #8237:
URL: https://github.com/apache/dubbo/issues/8237#issuecomment-877040402


   Thanks for reporting, it has bean fixed: https://github.com/apache/dubbo/pull/8242


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


[GitHub] [dubbo] kylixs closed issue #8237: org.apache.dubbo.config.ConfigCenterConfig#setAddress 会将 username 覆盖为 null

Posted by GitBox <gi...@apache.org>.
kylixs closed issue #8237:
URL: https://github.com/apache/dubbo/issues/8237


   


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