This topic describes the system architecture of Message Queue for Apache RocketMQ to help you better understand the high availability of Message Queue for Apache RocketMQ.

Message Queue for Apache RocketMQ is scalable in any environment and it requires that producers, message servers, and consumers be deployed in clusters. Cluster-level high availability is the key difference that sets Message Queue for Apache RocketMQ apart from other messaging servers. When a message producer sends a message to the messaging server, the messaging server selects a consumer at random and considers that the message is successfully consumed if this consumer successfully consumes this message.

Notice The messaging server of Message Queue for Apache RocketMQ mentioned in this topic includes both name servers and brokers, and not only brokers.

System architecture

The following figure shows the system architecture.Architecture

The concepts covered in the preceding figure are described as follows:

  • Name server: is a nearly stateless node that can be deployed in a cluster. It provides naming service in Message Queue for Apache RocketMQ for updating and discovering brokers.
  • Broker: is a message transit role that stores and forwards messages. Brokers are classified into primary and secondary brokers. One primary broker can be mapped to multiple secondary brokers. However, one secondary broker can be mapped to only one primary broker. After a broker is started, the broker needs to register itself with a name server. Subsequently, the broker regularly reports topic route information to the name server every 30 seconds.
  • Producer: establishes a persistent connection with a random name server in the name server cluster, and regularly reads topic route information from the name server. It also establishes a persistent connection with the primary broker that provides the topic service and regularly sends heartbeat packets to the primary broker.
  • Consumer: establishes a persistent connection with a random name server in the name server cluster, and regularly obtains topic route information from the name server. It also establishes persistent connections with the primary and secondary brokers that provide the topic service, and regularly sends heartbeat packets to the primary and secondary brokers. A consumer can consume messages from both the primary and secondary brokers. The consumption rules are determined by the configuration of the brokers.

References

For more information about the concepts in Message Queue for Apache RocketMQ, see Terms.