eureka-server-client启动流程
2020-02-09 22:06:42 0 举报
eureka 客户端和服务点启动流程
作者其他创作
大纲/内容
EurekaHttpClients#canonicalClientFactory
AbstractInstanceRegistry#register
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId></dependency>在这个依赖中有一个eureka客户端的依赖的jar包:<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-netflix-eureka-client</artifactId></dependency>进入jar保重查看到有对应的如下的结构:cloud/spring-cloud-netflix-eureka-client/2.1.2.RELEASE/spring-cloud-netflix-eureka-client-2.1.2.RELEASE.jar!/META-INF/spring.factories进入到spring.factories发现eureka客户端的自动配置
EurekaServerInitializerConfiguration#start
EurekaClientAutoConfiguration.RefreshableEurekaClientConfiguration#eurekaClient
AbstractJerseyEurekaHttpClient#getApplicationsInternal
RemoteRegionRegistry#fetchRemoteRegistry
DefaultEurekaServerContext
RefreshablePeerEurekaNodes
AbstractInstanceRegistry#initializedResponseCache
PeerAwareInstanceRegistryImpl#updateRenewalThreshold
服务续约
获得服务注册列表
AbstractInstanceRegistry#updateRenewsPerMinThreshold
RetryableEurekaHttpClient
EurekaClientAutoConfiguration#eurekaAutoServiceRegistration
SessionedEurekaHttpClient
EurekaServerMarkerConfiguration
RedirectingEurekaHttpClient
EurekaServerBootstrap
DiscoveryClient#register
DefaultEurekaServerContext#initialize
DiscoveryClient#initScheduledTasks
ResponseCacheImpl
AbstractJerseyEurekaHttpClient
往容器中添加了一个maker的bean
EurekaHttpClientDecorator#execute
EurekaClientAutoConfiguration.RefreshableEurekaClientConfiguration#eurekaApplicationInfoManager
InstanceRegistry#openForTraffic
PeerEurekaNodes#start
RemoteRegionRegistry#fetchRegistry
InstanceRegistry
@ConditionalOnBean({Marker.class})
DiscoveryClient#scheduleServerEndpointTask
RemoteRegionRegistry#fetchAndStoreDelta
EurekaServerBootstrap#contextInitialized
HeartbeatThread
ResponseCacheImpl#getCacheUpdateTask
DiscoveryClient#refreshInstanceInfo
EurekaServerHttpClients#createRemoteRegionClient
EurekaHttpClients#queryClientFactory
InstanceInfoReplicator#start
CacheRefreshThread
EurekaClientAutoConfiguration
AbstractInstanceRegistry#evict(long)
EnableEurekaServer(开启eureka服务端)
AbstractInstanceRegistry.EvictionTask#run
EurekaClientAutoConfiguration.RefreshableEurekaClientConfiguration#eurekaRegistration
MetricsCollectingEurekaHttpClient
JerseyEurekaHttpClientFactory
维护了服务注册列表
@Configuration@Import(EurekaServerInitializerConfiguration.class)EurekaServerAutoConfiguration(去掉部分东西,只保留关键内容)
PeerAwareInstanceRegistryImpl#init
DiscoveryClient#fetchRegistry
JerseyApplicationClient
AbstractJerseyEurekaHttpClient#getApplications
EurekaServerInitializerConfiguration
new RemoteRegionRegistry
AbstractJerseyEurekaHttpClient#register
从其他eureka节点拷贝服务注册列表
AbstractInstanceRegistry#postInit
PeerAwareInstanceRegistryImpl#scheduleRenewalThresholdUpdateTask
服务剔除
AbstractInstanceRegistry#initRemoteRegionRegistry
TransportClientFactories#newTransportClientFactory
DiscoveryClient#getAndStoreFullRegistry
@ConditionalOnBean(EurekaServerMarkerConfiguration.Marker.class)
SmartLifecycle,容器启动的时候自动调用start方法
PeerAwareInstanceRegistry#syncUp
响应缓存
EurekaHttpClientDecorator#getApplications
EurekaClientAutoConfiguration#eurekaServiceRegistry
eurekaClient
spring-cloud-netflix-eureka-server/2.1.2.RELEASE/spring-cloud-netflix-eureka-server-2.1.2.RELEASE.jar!/META-INF/spring.factories
PeerAwareInstanceRegistryImpl#openForTraffic
EurekaHttpClientFactory
EurekaDiscoveryClientConfiguration
PeerEurekaNodes#updatePeerEurekaNodes
InstanceInfoReplicator#run
收藏
收藏
0 条评论
下一页