Eureka源码
2020-07-15 10:37:32 0 举报
Eureka主流程源码
作者其他创作
大纲/内容
原生EurekaClient初始化EurekaRegistration.builder(instanceConfig).with(applicationInfoManager) .with(eurekaClient).with(healthCheckHandler).build()
增量缓存同步的一致性Hash校验
内存注册信息
submit
renew
statusChangeListener
refreshRegistry()
discoveryClient.register()
Server端读写缓存只读缓存注册会清空读写缓存,AP架构模式
registry.register
只读缓存读写缓存
清空读写缓存
eureka-core-1.9.21.jar
scheduler
InstanceInfoReplicator.this.run()
SpringCloud常规开局spring-cloud-starter-netflix-eureka-clientspring-cloud-netflix-eureka-clientspring.factories
AutoServiceRegistrationProperties
提交任务
start()
ResponseCacheImplgetValue()
回写同步
applicationInfoManager
instanceInfoReplicator.onDemandUpdate()
cacheRefreshTask
getAndUpdateDelta/eureka/apps/
readOnlyCacheMap
EurekaAutoServiceRegistration
scheduler.schedule()
ResponseCacheImpl初始化getCacheUpdateTask更新只读缓存默认30s
addInstance
invalidateCache
initScheduledTasks()
eurekaTransport.registrationClient.register(instanceInfo)
heartbeatTask
run()
RibbonLoadBanlance
scheduler.submit()
registerHealthCheck
TimedSupervisorTaskFutrue模式,超时则延长超时时间finaly循环调用定时任务
fetchRegistry()
Applications本地缓存
eurekaClient
EurekaClientConfiguration还有很多Bean
ApplicationResource
getAndStoreFullRegistry
getContainers
EurekaRegistration
readWriteCacheMap
this.serviceRegistry.register(this.registration)
server
EurekaClientAutoConfiguration
@InjectDiscoveryClient
updateDelta(delta)
notify
ApplicationsResource
register()失败会重新注册
0 条评论
回复 删除
下一页