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

HeartbeatThread run内容
Spring Cloud Eureka 源码跟踪(3.服务续约)
this.eurekaTransport.registrationClient.sendHeartBeat 向服务器发送心跳

相关文章:

  • 2021-11-23
  • 2021-10-27
  • 2021-11-02
  • 2021-08-15
  • 2021-09-05
  • 2019-11-05
  • 2021-12-19
猜你喜欢
  • 2021-11-12
  • 2021-12-19
  • 2021-06-06
  • 2021-04-18
  • 2022-01-01
  • 2022-12-23
  • 2021-09-05
相关资源
相似解决方案