xiangwangcheng commented on a change in pull request #793: [RIP-9] Add the introduction of the basic concepts in RocketMQ URL: https://github.com/apache/rocketmq/pull/793#discussion_r258354508
########## File path: docs/en/Concept.md ########## @@ -0,0 +1,41 @@ +# Basic Concept +## +## 1 Message Model + +The RocketMQ message model is mainly composed of a Producer, a Broker and a Consumer.The Producer is responsible for producing messages, the Consumer is responsible for consuming messages, and the Broker is responsible for storing messages. +A Broker corresponds to one server during actual deployment, and each Broker can store messages from multiple topics, and messages from each Topic can be stored in a different Broker by sharding strategy. +A Message Queue is used to store the physical addresses of messages, and the Message addresses in each Topic are stored in multiple Message queues.The Consumer Group consists of multiple Consumer instances. +## 2 Producer + A producer is responsible for producing messages, typically by business systems.It sends messages generated by the business application systems to brokers. RocketMQ provides multiple paradigms of sending: synchronous, asynchronous,sequential and one-way.Both synchronous and asynchronous methods require the Broker to return confirmation information, while one-way sending is not required. +## 3 Consumer + A Consumer responsible for consuming messages, typically the background system responsible for asynchronous consumption.A Consumer pulls messages from brokers and feeds them into application. In perspective of user application, two types of consumers are provided:Pull Consumer and Push Consumer. +## 4 Topic + Topic refers to a collection of messages, each of which contains several messages, each of which can belong to only one topic, and is the basic unit of RocketMQ for message subscription. +## 5 Broker Server +The message broker role, which stores and forwards messages.In the RocketMQ system, a Broker Server is responsible for receiving messages sent from producers, store them and prepare to handle pull requests from consumers.It also stores message related meta data, including consumer groups, consuming progress offsets , topic and queue info. +## 6 Name Server + Name server serves as the routing information provider. A producer or consumer can find a list of Broker IP addresses corresponding each topic through name server.Multiple Name server instances are clustered, but are independent of each other and do not exchange information. +## 7 Pull Consumer + A type of Consumer.Applications are usually pulls messages from brokers by actively calling the Consumer's pull message method,and the initiative is controlled by the application. Once batches of messages are pulled, user application initiates consuming process. +## 8 Push Consumer + A type of Consumer.Under this mode, after the Broker receives the data, it will actively push it to the consumer, which is generally of high real-time performance. +## 9 Producer Group + A collection of the same type of Producer, which sends the same type of messages with consistent logic.If a transaction message is sent and the original producer crashes after sending, the Broker server will contacts other Producer in the same Producer group to commit or roll back consumption. +## 10 Consumer Group + A collection of the same type of Consumer, which sends the same type of messages with consistent logic.Consumer Group achieve goals of load-balance and fault-tolerance, in terms of message consuming, is super easy. +Warning: consumer instances of a consumer group must have exactly the same topic subscription(s). + +RocketMQ supports two type of message mode:Clustering and Broadcasting. +## 11 Clustering +Under the Clustering mode, each Consumer instance of the same Consumer Group allocates messages equally. +## 12 Broadcasting Review comment: "Consumption Pattern - Broadcasting" will be more specific. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
