We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nacos 配置信息:
url: localhost:8080 username: nacos
复现代码:
@Data @Configuration @NacosConfigurationProperties(groupId = "production", dataId = "app-config.yaml", autoRefreshed = true) public class MysqlConfiguration { private String url; private String username; @PostConstruct public void init() { System.out.println("mysql url : " + url); # 输出: localhost:8080 System.out.println("mysql name: " + username); # 输出我的计算机名称: Dingyu.Cui } }
在上面代码中,输出的配置信息不是 nacos 里的配置,而是我的本地电脑信息。
在代码中,指定的配置文件优先级低于 systemProperties、systemEnvironment :
systemProperties
systemEnvironment
在这里我认为应该先以指定的 nacos 配置文件为准,以系统的环境信息为兜底更为合理
我将提交 pr 来修复这个问题
The text was updated successfully, but these errors were encountered:
[ISSUE nacos-group#323] adjust @NacosConfigurationProperties configur…
0314810
…ation priority
你了解下springboot的配置文件加载顺序,就是系统配置最高啊。
Sorry, something went wrong.
所以说这是预期的行为吗?用 NacosConfigurationProperties注解时,可以被本地的环境变量覆盖?
No branches or pull requests
Nacos 配置信息:
复现代码:
在上面代码中,输出的配置信息不是 nacos 里的配置,而是我的本地电脑信息。
在代码中,指定的配置文件优先级低于
systemProperties
、systemEnvironment
:在这里我认为应该先以指定的 nacos 配置文件为准,以系统的环境信息为兜底更为合理
我将提交 pr 来修复这个问题
The text was updated successfully, but these errors were encountered: