ROCKETMQ Principle Analysis-nameserver

Source: Internet
Author: User
Tags nameserver

Namesrv Name Service, is no state can be clustered horizontally.

1.      Each broker starts with a 2 registration to Namesrv .      Producer gets the information that is routed to the broker when the message is sent by Topic 3.      Consumer topic to NAMESRV to obtain topic routing to broker information
One: namesrv function:

   Requests from the receiving broker to register broker routing information (both master and slave)   receive client requests based on a topic to obtain all routing information to the broker

II: NAMESRV Start-up process:

Three: Routeinfomanager Management of routing information Routeinfomanager class
Brokername represents a set of brokers, such as a brokername=broker-A, which may include a master with its multiple slavemap<brokername, brokerdata> Brokerdata whether the brokername and its broker IDs and address                   IDs represent master or slave                   id= 0 for master  greater than 0 for Slavemap <topic, list<queuedata>>queuedata by brokername, read queue number, write queue number, already permission value map<clustername,set <brokerName>>   The broker is grouped by cluster map<brokeraddr, brokerliveinfo> brokerliveinfo Represents a live broker link by the last update time, a link channel, data version and HA address that comprise the broker timed to register with NAMESRV and update Brokerliveinfo timestamp

Four: The heartbeat between Namesrv and broker:
1.      When the broker starts, it initiates a timed task, sending a heartbeat request to all namesrv every 10 seconds, as well as registering topic information to NAMESRV2.      Namesrv receive Register_broke event handling for Borker Heartbeat Defaultrequestprocessor, (1)      Register Broker's topic information (2)      Build or update the timestamp of Brokerliveinfo 3.      Namesrvcontroller initialization thread periodically calls Routeinfomanger's Scannotactivebroker method to periodically clean up the inactive broker
(Default two minutes does not send heartbeat update to NAMESRV brokerliveinfo timestamp), compare Brokerliveinfo timestamp, close channel connection if expired

ROCKETMQ Principle Analysis-nameserver

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.