Skip to content
New issue

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

yml配置刷新 开启autoRefreshed为啥不刷新配置呢? #217

Open
ssun-o1 opened this issue Dec 8, 2021 · 4 comments
Open

yml配置刷新 开启autoRefreshed为啥不刷新配置呢? #217

ssun-o1 opened this issue Dec 8, 2021 · 4 comments

Comments

@ssun-o1
Copy link

ssun-o1 commented Dec 8, 2021

nacos-config-spring-boot-starter (version-0.2.8) yml文件开始预加载 bootstrap.enable & autoRefreshed:true 为什么不刷新配置呢?

@elang0705
Copy link

我的是springboot2.0.0+nacos-config-spring-boot-starter0.2.7 也遇到这问题,不自动刷新

@hujun-w-2
Copy link
Collaborator

用的哪个注解?

@zhuqingchao
Copy link

NacosValue(value = "${xxx}", autoRefreshed = true) 就不会自动刷新。
必须在 启动类上添加 @NacosPropertySource(dataId = "xxx", autoRefreshed = true) 才能自动刷新。
这是为啥?
已经在 application.yml 里配置了。nacos.config.auto-refresh=true 了, 但完全没有生效。 稍微跟了下源码。 NacosPropertySource 注解和 NacosConfigProperties 走的两条路径。
@hujun-w-2 麻烦看下。 NacosPropertySource 是否必须

@andyge2014
Copy link

NacosValue(value = "${xxx}", autoRefreshed = true) 就不会自动刷新。 必须在 启动类上添加 @NacosPropertySource(dataId = "xxx", autoRefreshed = true) 才能自动刷新。 这是为啥? 已经在 application.yml 里配置了。nacos.config.auto-refresh=true 了, 但完全没有生效。 稍微跟了下源码。 NacosPropertySource 注解和 NacosConfigProperties 走的两条路径。 @hujun-w-2 麻烦看下。 NacosPropertySource 是否必须

NacosPropertySource注解和yml中主配置及ext-config[index]配置的关系及使用场景是怎么样的,哪里有具体文档说明?我试过这种场景:
启动类中加上注解NacosPropertySource ,并且在yml配了主配置nacos.config.auto-refresh=true,nacos.config.bootstrap.enable=true,NacosValue(value = "${xxx}", autoRefreshed = true)依然不会自动刷新;
以上不配置bootstrap.enable=true,NacosValue就可以刷新。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants