apollo icon indicating copy to clipboard operation
apollo copied to clipboard

使用EnvironmentChangeEvent 但是配置没有更新

Open Shy-Chen opened this issue 1 year ago • 1 comments

参考官方的demo 使用如下这种方式来刷新@ConfigurationProperties配置文件 但是没有生效 this.applicationContext.publishEvent(new EnvironmentChangeEvent(changedKeys)); 请教下这个是什么问题?

Shy-Chen avatar Sep 20 '24 05:09 Shy-Chen

需要注意的是,@ConfigurationProperties如果需要在Apollo配置变化时自动更新注入的值,需要配合使用EnvironmentChangeEventRefreshScope。相关代码实现,可以参考apollo-use-cases项目中的ZuulPropertiesRefresher.java和apollo-demo项目中的SampleRedisConfig.java以及SpringBootApolloRefreshConfig.java

nobodyiam avatar Sep 23 '24 01:09 nobodyiam

This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 29 '24 22:10 stale[bot]

This issue has been automatically closed because it has not had activity in the last 7 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.

stale[bot] avatar Nov 09 '24 01:11 stale[bot]