nacos-spring-boot-project
nacos-spring-boot-project copied to clipboard
yml配置刷新 开启autoRefreshed为啥不刷新配置呢?
nacos-config-spring-boot-starter (version-0.2.8) yml文件开始预加载 bootstrap.enable & autoRefreshed:true 为什么不刷新配置呢?
我的是springboot2.0.0+nacos-config-spring-boot-starter0.2.7 也遇到这问题,不自动刷新
用的哪个注解?
NacosValue(value = "${xxx}", autoRefreshed = true) 就不会自动刷新。 必须在 启动类上添加 @NacosPropertySource(dataId = "xxx", autoRefreshed = true) 才能自动刷新。 这是为啥? 已经在 application.yml 里配置了。nacos.config.auto-refresh=true 了, 但完全没有生效。 稍微跟了下源码。 NacosPropertySource 注解和 NacosConfigProperties 走的两条路径。 @hujun-w-2 麻烦看下。 NacosPropertySource 是否必须
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就可以刷新。