2021-11-08 真实记录nacos看源码流程

午休时间把nacos1.1.4源码下下来了然后开始看源码

每天真实记录

Demo里面 NamingExample里面开始看起

NacosNamingService

//初始化各种配置

namespace = InitUtils.initNamespaceForNaming(properties);

initServerAddr(properties);

InitUtils.initWebRootContext();

initCacheDir();

initLogName(properties);

//新建了一个线程池  线程池会每隔五分钟从队列里面拉取 serviceInfo(目前看serviceInfo应该是注册表)

eventDispatcher =new EventDispatcher();

serverProxy =new NamingProxy(namespace, endpoint, serverList);

serverProxy.setProperties(properties);

//发送心跳线程池

beatReactor =new BeatReactor(serverProxy, initClientBeatThreadCount(properties));

//

hostReactor =new HostReactor(eventDispatcher, serverProxy, cacheDir, isLoadCacheAtStart(properties), initPollingThreadCount(properties));

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容