spring容器配置的热更新
2022-05-06 20:01:09 0 举报
登录查看完整内容
为你推荐
查看更多
spring源码,spring容器配置的热更新
作者其他创作
大纲/内容
发布事件RefreshRemoteApplicationEvent
RefreshListener.onApplicationEvent()
手工触发/消息总线
配置的刷新过程ContextRefresher.refreshEnvironment()
接收事件并处理
2种类型的配置需要刷新一类:@ConfigurationProperties,步骤⑤完成另一类:@RefreshScope的bean,步骤⑥完成
通过ConfigurationPropertiesBeans可以拿到所有的@ConfigurationProperties的bean,然后重新加载bean
ConfigurationPropertiesRebinder.onApplicationEvent()
RefreshBusEndpoint.busRefresh()
⑤发布配置变更事件:EnvironmentChangeEvent
重新加载配置到容器环境中
bus-refresh,http请求
ContextRefresher.refresh()
收藏
0 条评论
回复 删除
下一页