RocketMQ (1) basic concepts

basic concept


1 Message Model (Message Model)

RocketMQ is mainly composed of three parts: Producer, Broker, and Consumer. Producer is responsible for producing messages, Consumer is responsible for consuming messages, and Broker is responsible for storing messages. Broker corresponds to a server in the actual deployment process. Each Broker can store multiple Topic messages, and each Topic message can also be stored in different Brokers in fragments. Message Queue is used to store the physical address of the message. The message address in each topic is stored in multiple Message Queues. ConsumerGroup consists of multiple Consumer instances.

2 Message Producer (Producer)

Responsible for producing messages, generally the business system is responsible for producing messages. A message producer will send the messages generated in the business application system to the broker server. RocketMQ provides multiple sending methods, synchronous sending, asynchronous sending, sequential sending and one-way sending. Both synchronous and asynchronous methods require Broker to return confirmation information, and one-way transmission is not required.

3 Message Consumer (Consumer)

Responsible for consuming messages, generally the background system is responsible for asynchronous consumption. A message consumer will pull messages from the Broker server and provide them to the application. From the perspective of user applications, two forms of consumption are provided: pull consumption and push consumption.

4 Topic

Represents a collection of messages of one type. Each topic contains several messages, and each message can only belong to one topic. It is the basic unit of RocketMQ for message subscription.

5 Proxy server (Broker Server)

The message relay role is responsible for storing and forwarding messages. The proxy server is responsible for receiving and storing messages sent from producers in the RocketMQ system, and at the same time preparing for consumers' pull requests. The proxy server also stores message-related metadata, including consumer groups, consumption progress offsets, topics and queue messages, etc.

6 Name Service (Name Server)

The name service acts as a provider of routing messages. Producers or consumers can look up the Broker IP list corresponding to each topic through the name service. Multiple Namesrv instances form a cluster, but they are independent of each other and there is no information exchange.

7 Pull Consumer

A type of consumer consumption. The application usually calls the Consumer's pull message method to pull messages from the Broker server, and the initiative is controlled by the application. Once the batch of messages is obtained, the application starts the consumption process.

8 Push Consumer

A type of consumer consumption. In this mode, the Broker will actively push the data to the consumer after receiving the data. This consumption mode is generally more real-time.

9 Producer Group (Producer Group)

A collection of Producers of the same type. This type of Producer sends the same type of messages with the same sending logic. If the transaction message is sent and the original producer crashes after sending, the Broker server will contact other producer instances in the same producer group to commit or retrospective consumption.

10 Consumer Group (Consumer Group)

A collection of consumers of the same type. This type of Consumer usually consumes the same type of messages with consistent consumption logic. Consumer groups make it very easy to achieve load balancing and fault tolerance in terms of message consumption. It should be noted that the consumer instances of the consumer group must subscribe to the same topic. RocketMQ supports two message modes: Clustering and Broadcasting.

11 Cluster consumption (Clustering)

In the cluster consumption mode, each Consumer instance of the same Consumer Group distributes messages equally.

12 Broadcasting consumption (Broadcasting)

In the broadcast consumption mode, each Consumer instance of the same Consumer Group receives the full amount of messages.

13 Normal Ordered Message (Normal Ordered Message)

In the normal sequential consumption mode, messages received by consumers through the same consumption queue are in order, while messages received by different message queues may be out of order.

14 Strictly Ordered Message

In strict order message mode, all messages received by consumers are in order.

15 Message

The physical carrier of the information transmitted by the message system, the smallest unit of production and consumption of data, each message must belong to a topic. Each message in RocketMQ has a unique Message ID and can carry a Key with a service ID. The system provides the function of querying messages through Message ID and Key.

16 Tag

The flag set for the message is used to distinguish different types of messages under the same subject. Messages from the same business unit can be set with different tags under the same subject according to different business purposes. Tags can effectively maintain the clarity and continuity of the code, and optimize the query system provided by RocketMQ. Consumers can implement different consumption logics for different sub-topics according to Tag to achieve better scalability.

17 Original Link

注释:来源于GitHub
https://github.com/apache/rocketmq/blob/master/docs/cn/README.md

Guess you like

Origin blog.csdn.net/shang_xs/article/details/110491763