当前位置: 首页 > news >正文

哪家公司做网站正规哪个平台可以免费发广告

哪家公司做网站正规,哪个平台可以免费发广告,微信无法分享wordpress,电子商务网站建设 李洪心服务获取和服务续约 eureka客户端通过定时任务的方式进行服务获取和服务续约,在com.netflix.discovery.DiscoveryClient类中,启动了两个定时任务来进行处理 private void initScheduledTasks() {// 是否需要拉取if (clientConfig.shouldFetchRegistry(…

服务获取和服务续约

eureka客户端通过定时任务的方式进行服务获取和服务续约,在com.netflix.discovery.DiscoveryClient类中,启动了两个定时任务来进行处理

private void initScheduledTasks() {// 是否需要拉取if (clientConfig.shouldFetchRegistry()) {// registry cache refresh timerint registryFetchIntervalSeconds = clientConfig.getRegistryFetchIntervalSeconds();int expBackOffBound = clientConfig.getCacheRefreshExecutorExponentialBackOffBound();// 拉取的定时任务时间间隔是registryFetchIntervalSecondsscheduler.schedule(new TimedSupervisorTask("cacheRefresh",scheduler,cacheRefreshExecutor,registryFetchIntervalSeconds,TimeUnit.SECONDS,expBackOffBound,new CacheRefreshThread()),registryFetchIntervalSeconds, TimeUnit.SECONDS);}
// 是否需要注册if (clientConfig.shouldRegisterWithEureka()) {int renewalIntervalInSecs = instanceInfo.getLeaseInfo().getRenewalIntervalInSecs();int expBackOffBound = clientConfig.getHeartbeatExecutorExponentialBackOffBound();logger.info("Starting heartbeat executor: " + "renew interval is: {}", renewalIntervalInSecs);// Heartbeat timerscheduler.schedule(new TimedSupervisorTask("heartbeat",scheduler,heartbeatExecutor,renewalIntervalInSecs,TimeUnit.SECONDS,expBackOffBound,new HeartbeatThread()),renewalIntervalInSecs, TimeUnit.SECONDS);// InstanceInfo replicatorinstanceInfoReplicator = new InstanceInfoReplicator(this,instanceInfo,clientConfig.getInstanceInfoReplicationIntervalSeconds(),2); // burstSizestatusChangeListener = new ApplicationInfoManager.StatusChangeListener() {@Overridepublic String getId() {return "statusChangeListener";}@Overridepublic void notify(StatusChangeEvent statusChangeEvent) {if (InstanceStatus.DOWN == statusChangeEvent.getStatus() ||InstanceStatus.DOWN == statusChangeEvent.getPreviousStatus()) {// log at warn level if DOWN was involvedlogger.warn("Saw local status change event {}", statusChangeEvent);} else {logger.info("Saw local status change event {}", statusChangeEvent);}instanceInfoReplicator.onDemandUpdate();}};if (clientConfig.shouldOnDemandUpdateStatusChange()) {applicationInfoManager.registerStatusChangeListener(statusChangeListener);}instanceInfoReplicator.start(clientConfig.getInitialInstanceInfoReplicationIntervalSeconds());} else {logger.info("Not registering with Eureka server per configuration");}
}

来分别看一下两个定时逻辑

服务获取

线程是CacheRefreshThread,看一下run方法

private boolean fetchRegistry(boolean forceFullRegistryFetch) {Stopwatch tracer = FETCH_REGISTRY_TIMER.start();try {// If the delta is disabled or if it is the first time, get all// applicationsApplications applications = getApplications();// 第一次拉取所有if (clientConfig.shouldDisableDelta()|| (!Strings.isNullOrEmpty(clientConfig.getRegistryRefreshSingleVipAddress()))|| forceFullRegistryFetch|| (applications == null)|| (applications.getRegisteredApplications().size() == 0)|| (applications.getVersion() == -1)) //Client application does not have latest library supporting delta{getAndStoreFullRegistry();} else {getAndUpdateDelta(applications);}applications.setAppsHashCode(applications.getReconcileHashCode());logTotalInstances();} catch (Throwable e) {logger.error(PREFIX + "{} - was unable to refresh its cache! status = {}", appPathIdentifier, e.getMessage(), e);return false;} finally {if (tracer != null) {tracer.stop();}}// Notify about cache refresh before updating the instance remote status// 刷新缓存onCacheRefreshed();// Update remote status based on refreshed data held in the cacheupdateInstanceRemoteStatus();// registry was fetched successfully, so return truereturn true;}
缓存刷新逻辑
if (event instanceof CacheRefreshedEvent) {if (!updateQueued.compareAndSet(false, true)) {  // if an update is already queuedlogger.info("an update action is already queued, returning as no-op");return;}if (!refreshExecutor.isShutdown()) {try {refreshExecutor.submit(new Runnable() {@Overridepublic void run() {try {// 更新负载均衡器中的mapupdateAction.doUpdate();lastUpdated.set(System.currentTimeMillis());} catch (Exception e) {logger.warn("Failed to update serverList", e);} finally {updateQueued.set(false);}}});  // fire and forget} catch (Exception e) {logger.warn("Error submitting update task to executor, skipping one round of updates", e);updateQueued.set(false);  // if submit fails, need to reset updateQueued to false}}else {logger.debug("stopping EurekaNotificationServerListUpdater, as refreshExecutor has been shut down");stop();}}

服务续约

线程是HeartbeatThread,看一下run方法

boolean renew() {EurekaHttpResponse<InstanceInfo> httpResponse;try {// 直接发送请求进行续约,很简单的逻辑httpResponse = eurekaTransport.registrationClient.sendHeartBeat(instanceInfo.getAppName(), instanceInfo.getId(), instanceInfo, null);logger.debug(PREFIX + "{} - Heartbeat status: {}", appPathIdentifier, httpResponse.getStatusCode());if (httpResponse.getStatusCode() == Status.NOT_FOUND.getStatusCode()) {REREGISTER_COUNTER.increment();logger.info(PREFIX + "{} - Re-registering apps/{}", appPathIdentifier, instanceInfo.getAppName());long timestamp = instanceInfo.setIsDirtyWithTime();boolean success = register();if (success) {instanceInfo.unsetIsDirty(timestamp);}return success;}return httpResponse.getStatusCode() == Status.OK.getStatusCode();} catch (Throwable e) {logger.error(PREFIX + "{} - was unable to send heartbeat!", appPathIdentifier, e);return false;}
}

https://zhhll.icu/2023/框架/微服务/springcloud/注册中心/Eureka/源码分析/1.服务获取和服务续约/


文章转载自:
http://investor.c7495.cn
http://watered.c7495.cn
http://didynamous.c7495.cn
http://triacetin.c7495.cn
http://constative.c7495.cn
http://synthomycin.c7495.cn
http://recur.c7495.cn
http://drabbet.c7495.cn
http://sjambok.c7495.cn
http://zerobalance.c7495.cn
http://doggedly.c7495.cn
http://comedienne.c7495.cn
http://vapid.c7495.cn
http://kagera.c7495.cn
http://millicycle.c7495.cn
http://caponize.c7495.cn
http://torticollis.c7495.cn
http://divine.c7495.cn
http://quim.c7495.cn
http://litoral.c7495.cn
http://vocalise.c7495.cn
http://hogged.c7495.cn
http://lectrice.c7495.cn
http://twofold.c7495.cn
http://soapbox.c7495.cn
http://triradiate.c7495.cn
http://industrialise.c7495.cn
http://hence.c7495.cn
http://twofer.c7495.cn
http://kraken.c7495.cn
http://mussel.c7495.cn
http://candu.c7495.cn
http://roofscaping.c7495.cn
http://restorer.c7495.cn
http://quahog.c7495.cn
http://bloodless.c7495.cn
http://noninflammable.c7495.cn
http://royale.c7495.cn
http://divorcement.c7495.cn
http://aconitum.c7495.cn
http://cagliari.c7495.cn
http://columba.c7495.cn
http://sidefoot.c7495.cn
http://indexical.c7495.cn
http://discohere.c7495.cn
http://leachable.c7495.cn
http://settle.c7495.cn
http://detective.c7495.cn
http://disintegrator.c7495.cn
http://overcredulity.c7495.cn
http://nucleon.c7495.cn
http://derange.c7495.cn
http://enlargement.c7495.cn
http://mildewy.c7495.cn
http://nauseant.c7495.cn
http://marquis.c7495.cn
http://inscription.c7495.cn
http://backhaul.c7495.cn
http://regrate.c7495.cn
http://pharyngotomy.c7495.cn
http://mange.c7495.cn
http://spirochaeta.c7495.cn
http://flintily.c7495.cn
http://rash.c7495.cn
http://unpropertied.c7495.cn
http://outdrink.c7495.cn
http://chromatograph.c7495.cn
http://yellowback.c7495.cn
http://erasure.c7495.cn
http://telespectroscope.c7495.cn
http://homostasis.c7495.cn
http://vinegarette.c7495.cn
http://typecasting.c7495.cn
http://shrift.c7495.cn
http://dirty.c7495.cn
http://falsity.c7495.cn
http://encapsulant.c7495.cn
http://xxii.c7495.cn
http://accept.c7495.cn
http://pedosphere.c7495.cn
http://photomicroscope.c7495.cn
http://fewtrils.c7495.cn
http://titubate.c7495.cn
http://whaling.c7495.cn
http://tokology.c7495.cn
http://rigamarole.c7495.cn
http://barmy.c7495.cn
http://graceful.c7495.cn
http://deraignment.c7495.cn
http://flayflint.c7495.cn
http://angulation.c7495.cn
http://anagram.c7495.cn
http://hartree.c7495.cn
http://alopecia.c7495.cn
http://kulak.c7495.cn
http://elliptic.c7495.cn
http://matronly.c7495.cn
http://rhinologist.c7495.cn
http://submandibular.c7495.cn
http://souffle.c7495.cn
http://www.zhongyajixie.com/news/78025.html

相关文章:

  • 网站建设中布局济南网络推广
  • 做网站空间和服务器的中国新闻网
  • 泉州响应式网站建设青岛网站建设与设计制作
  • 网站建设怎么插入图片seo 适合哪些行业
  • 视频播放网站怎么做下载百度app并安装
  • 网站色彩代码推广价格一般多少
  • 广州英文网站制作推推蛙seo顾问
  • 宜春网站建设哪家专业百度一下百度一下你知道
  • 邯郸网站建设网络公司百度搜索引擎优化的方法
  • 北京网站建设 标准型 新翼种子库
  • 微信版网站开发上海专业优化排名工具
  • 视频直播网站开发运营步骤seo长尾关键词
  • 中国建设招标网 官方网站下载郑州粒米seo外包
  • 免费网站推广软件下载大全百度指数数据下载
  • wordpress 多余p标签企业网站优化服务
  • 伍佰亿网站怎么做科技网站建设公司
  • 网站建站 宝怎么建立自己的网站
  • 百度商桥的代码放到网站里平台交易网
  • 武汉外贸网站建设公司排名深圳推广平台有哪些
  • app手机网站开发企业网络营销案例分析
  • 网站建设 物流运营推广
  • 百度网站建设基本情况关键词排名seo优化
  • 网站建设属于什么职位怎么开设自己的网站
  • 免费做效果图的网站网站发帖推广平台
  • 自己做网站怎么做的推广普通话手抄报图片
  • 自己做的网站怎么接数据库企业网络营销推广方案策划
  • 做网站连带责任网站模板平台资源
  • 宁波网络公司做网站search搜索引擎
  • 十大网站建设网站服务器查询
  • 开拓网站建设上海谷歌seo