@RefreshScope
时间: 2023-09-28 10:08:20 浏览: 102
RefreshList:测试@RefreshScope
@RefreshScope是一个Spring Cloud注解,用于实现配置的动态刷新。要实现配置的动态刷新,需要满足以下几个条件:使用@Scope注解、@RefreshScope注解、RefreshScope类、GenericScope类、Scope接口和ContextRefresher类。
@Scope注解有两个主要属性value和proxyMode,其中proxyMode是@RefreshScope实现的本质。@RefreshScope注解的实现是通过扩展GenericScope类来实现的,而GenericScope类又实现了Scope接口。
因此,@RefreshScope注解可以使被标记的Bean在配置发生改变时进行动态刷新,而不需要重启应用程序。这对于需要实时更新配置的场景非常有用。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [SpringCloud配置动态刷新@RefreshScope注解](https://blog.csdn.net/JokerLJG/article/details/120254643)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文