In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
In this issue, the editor will bring you about the role of ServiceReporter in nacos. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.
ServiceManager.init
Nacos-1.1.3/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceManager.java
@ Component@DependsOn ("nacosApplicationContext") public class ServiceManager implements RecordListener {/ * * Map * / private Map serviceMap = new ConcurrentHashMap (); private LinkedBlockingDeque toBeUpdatedServicesQueue = new LinkedBlockingDeque (1024 * 1024); private Synchronizer synchronizer = new ServiceStatusSynchronizer (); private final Lock lock = new ReentrantLock (); @ Resource (name = "consistencyDelegate") private ConsistencyService consistencyService; @ Autowired private SwitchDomain switchDomain; @ Autowired private DistroMapper distroMapper; @ Autowired private ServerListManager serverListManager; @ Autowired private PushService pushService Private final Object putServiceLock = new Object (); @ PostConstruct public void init () {UtilsAndCommons.SERVICE_SYNCHRONIZATION_EXECUTOR.schedule (new ServiceReporter (), 60000, TimeUnit.MILLISECONDS); UtilsAndCommons.SERVICE_UPDATE_EXECUTOR.submit (new UpdatedServiceProcessor ()); try {Loggers.SRV_LOG.info ("listen for service meta change"); consistencyService.listen (KeyBuilder.SERVICE_META_KEY_PREFIX, this) } catch (NacosException e) {Loggers.SRV_LOG.error ("listen for service meta change failed!");}} /.}
The init method of ServiceManager registers ServiceReporter with UtilsAndCommons.SERVICE_SYNCHRONIZATION_EXECUTOR
ServiceReporter
Nacos-1.1.3/naming/src/main/java/com/alibaba/nacos/naming/core/ServiceManager.java
Private class ServiceReporter implements Runnable {@ Override public void run () {try {Map allServiceNames = getAllServiceNames (); if (allServiceNames.size ()
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.