Spring Cloud Eureka 源码跟踪(3.服务续约)

通过定时线程类(ScheduledExecutorService scheduler)间隔renewalIntervalInSecs(默认30s)执行DiscoveryClient.HeartbeatThread方法获取服务。
Spring Cloud Eureka 源码跟踪(3.服务续约)_第1张图片
this.scheduler.schedule(new TimedSupervisorTask(“heartbeat”, this.scheduler, this.heartbeatExecutor, renewalIntervalInSecs, TimeUnit.SECONDS, expBackOffBound, new DiscoveryClient.HeartbeatThread()), (long)renewalIntervalInSecs, TimeUnit.SECONDS);

HeartbeatThread run内容
在这里插入图片描述
this.eurekaTransport.registrationClient.sendHeartBeat 向服务器发送心跳

你可能感兴趣的:(eureka,eureka服务续约)