You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2018/06/15 07:49:51 UTC

[GitHub] xpyzh opened a new issue #340: namesrv服务中NamesrvController保存的configuration有问题

xpyzh opened a new issue #340: namesrv服务中NamesrvController保存的configuration有问题
URL: https://github.com/apache/rocketmq/issues/340
 
 
   看了下namesrv启动这部分的代码,加载顺序如下:
   step1.args中解析-c参数,读取属性文件,并覆盖NamesrvConfig和NettyServerConfig类的默认属性
   step2.args中解析其他参数,如果包含NamesrvConfig类中的属性,则将其覆盖
   step3.根据NamesrvConfig和NettyServerConfig初始化NamesrvController类(这时候应该是最终的配置文件)
   step4.用step1中读取的属性文件去覆盖NamesrvController类中的属性,保存在configuration变量中
   
   
   > step4中的覆盖行为保存的其实并不是namesrv最终生效的配置。有问题的代码如下:
   
   //todo:这个地方的覆盖了实际最终生效的配置
   controller.getConfiguration().registerConfig(properties);
   
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services