In order to evolve towards cloud native and improve resource utilization and elasticity, RocketMQ adjusted and upgraded its architecture in 5.0. Proxy layerArchitecture before RocketMQ5.0: Previously, RocketMQ5.0 used a custom Remoting protocol based on Netty for network communication. Computing and storage were integrated and all in Broker. Producers and consumers pull routing information from NameServer, and then interact directly with Broker to produce and consume messages. picture RocketMQ5.0 architecture: After 5.0, the elastic stateless proxy mode was introduced, and the responsibilities of the Broker were split. The computing logic such as client protocol adaptation, permission management, and consumption management are extracted and placed in the Proxy layer, and Broker focuses on data storage.
And support for the GRPC protocol was added after 5.0.
picture POP consumption modelBefore RocketMQ 5.0: There are two ways to get messages from Broker: Pull mode and Push mode. Pull mode: Consumers need to continuously obtain data from the blocking queue. If there is no data, they will wait. The data in this blocking queue is added by the message pulling thread after pulling messages from the Broker. Therefore, consumption in Pull mode needs to continuously and actively pull messages from Broker. Push mode: A message listener needs to be registered. When a message arrives, the message will be consumed through a callback function. On the surface, it looks like the Broker actively pushes it to the consumer, so it is called push mode. The underlying layer is still that the consumer pulls data from the Broker and then triggers the callback function to consume the message, but there is no need to constantly determine whether there is a message arriving like in the Pull mode. RocketMQ5.0 Functions such as load balancing and consumer site management are placed on the Broker side to reduce the burden on the client, making it lightweight, and after 5.0, message-based load balancing is supported. Message granularity load balancing: In the message granularity load balancing strategy, multiple consumers in the same consumer group will evenly share all messages in the topic according to the message granularity.
POP message consumption: First, the client (consumer) sends a Pop request to the server (Broker). After receiving the request, the Broker obtains the message in Pop mode and then returns it to the client. After the client successfully consumes the message, it sends an ACK request to the Broker to confirm that the message consumption is successful. picture Controller ModeBefore RocketMQ5.0, there were two cluster deployment modes, namely Master-Slave mode and Dledger mode. RocketMQ 5.0 and later introduced the Controller mode, which has the following features: In the master-slave deployment mode, it has the ability to automatically switch the Master. Before 5.0, DLedger was required. You can use RocketMQ's native storage and replication capabilities and unify RocketMQ's storage and replication capabilities. RocketMQ 5.0 has separated the Broker leader election related functions and placed them in the Controller. Automatic switching of Master is achieved in master-slave deployment mode. Controller can be deployed independently or embedded in NameServer. Controller under independent deployment: picture The deployment diagram embedded in NameServer is as follows: picture refer to: https://rocketmq.apache.org/version/ https://developer.aliyun.com/article/801815 https://rocketmq.apache.org/zh/docs/deploymentOperations/03autofailover/ |
<<: When do microservices use the Http protocol to communicate, and when do they use Lrpc?
The high-speed 3GPP 5G standard work may encounte...
DogYun has launched a promotion during this year&...
Let's continue to share information about Max...
Some people say that WIFI is the vitamin of the I...
【51CTO.com Quick Translation】I have been a comic ...
At the 2020 China Radio Conference which opened y...
Does your IT team have too much data and not enou...
CMIVPS has launched this month's promotion, o...
[[419120]] Last month, the Ministry of Industry a...
Labs Guide Before the emergence of WebSocket, the...
On June 6, 2022, as 5G licenses were issued for t...
In May this year, we shared information about VMI...
Throughout 2021, Cisco has been the biggest acqui...
Greater emphasis on data Telecommunications busin...
ZJI is a well-known hosting company in the WordPr...