All Products
Search
Document Center

ApsaraMQ for RocketMQ:Service architecture

Last Updated:Mar 11, 2026

ApsaraMQ for RocketMQ scales in any environment. Producers, messaging servers, and consumers all run in clusters. This cluster-level high availability is what sets ApsaraMQ for RocketMQ apart from other messaging servers.

When a producer sends a message, the messaging server selects a consumer at random. The message is considered successfully consumed after that consumer processes it.

Important

In this topic, "messaging server" refers to the combined infrastructure of name servers and brokers, not brokers alone.

Architecture overview

The following figure shows the system architecture.

Architecture

Servers

Name server

A name server is a nearly stateless node that provides the naming service: discovering and updating broker information. Name servers can be deployed in a cluster.

Broker

A broker stores and forwards messages. Brokers are classified into primary and secondary brokers:

  • One primary broker can map to multiple secondary brokers.

  • Each secondary broker maps to exactly one primary broker.

On startup, a broker registers itself with a name server and then reports topic route information every 30 seconds.

Clients

Producer

Each producer maintains two persistent connections:

Connection targetBehavior
A random name server in the clusterRegularly reads topic route information
The primary broker for the relevant topicSends periodic heartbeats

Consumer

Each consumer also maintains persistent connections to both server types:

Connection targetBehavior
A random name server in the clusterRegularly gets topic route information
Both primary and secondary brokers for the relevant topicSends periodic heartbeats to each

Unlike producers, consumers can retrieve messages from both primary and secondary brokers. The broker configuration determines which consumption rules apply.

See also

Terms