Spring Cloud Config源码分析
2021-07-02 14:08:45 2 举报
此图是我对Spring Cloud Config源码注册中心的理解,供大家学习交流
作者其他创作
大纲/内容
EnvironmentRepositoryConfiguration
http://localhost:9810/actuator/bus-refresh
ConfigServerHealthIndicator#doHealthCheck
ConfigServerHealthIndicator
@Bean
SpringApplication#run
Springboot启动上下文环境
ConfigServerAutoConfiguration
spring-cloud-config-server-2.1.4.RELEASE.jar!/META-INF/spring.factories
http请求
this.applicationEventPublisher.publishEvent(event)
获取git最新版本的key
获取环境
BusAutoConfiguration#acceptRemote
restTemplate调用config server接口
2. 获取环境
调用config server的接口
git.getRepository().findRef(\"HEAD\").getObjectId().getName()
EnvironmentController#yaml
@RequestMapping(\"/{name}/{profiles}/{label:.*}\")
EnvironmentController#labelled
CompositeHealthIndicator#health
ConfigServicePropertySourceLocator
spring-cloud-config-client-2.1.4.RELEASE.jar!/META-INF/spring.factories
ConfigServicePropertySourceLocator#locate
refreshEnvironment()
ConfigServiceBootstrapConfiguration
@EnableConfigServer
MultipleJGitEnvironmentRepository
String version = refresh(label)
提交bus-refresh请求
激活
RefreshListener#onApplicationEvent
发布事件
调用springboot的run方法
@RequestMapping({ \"/{name}-{profiles}.yml\
config server服务启动
@Import
1. 获取资源搜索路径
@StreamListener(SpringCloudBusClient.INPUT)
localhost:9800/config-eureka-client-dev.yml
0 条评论
回复 删除
下一页