EurekaServer启动流程(一)
2019-06-25 16:36:52 0 举报
EurekaServer启动流程
作者其他创作
大纲/内容
EurekaServerInitializerConfiguration # start()
@Configuration@Import(EurekaServerInitializerConfiguration.class)@ConditionalOnBean(EurekaServerMarkerConfiguration.Marker.class)EurekaServerAutoConfiguration
EurekaServer真正的启动方法
publish(new EurekaServerStartedEvent(getEurekaServerConfig()));
EurekaServerBootstrap # contextInitialized(ServletContext context)
这是一个标志类。有这个标志类就会加载EurekaServerAutoConfiguration
@EnableEurekaServer
注意这里有个SmartLifecycle接口。SmartLifecycle中的start()接口会在spring容器启动完成后调用
发布Eureka可以被注册事件
发布EurekaServer启动成功事件
@Import(EurekaServerMarkerConfiguration.class)
Eureka Server启动流程
@Import(EurekaServerInitializerConfiguration.class)
publish(new EurekaRegistryAvailableEvent(getEurekaServerConfig()));
0 条评论
下一页