RocketMQ version of message queue is a distributed message middleware with low latency, high concurrency, high availability and high reliability built by Ali Cloud based on Apache RocketMQ. Message queue RocketMQ not only provides asynchronous decoupling and peak-filling capabilities for distributed applications, but also features massive message stacking, high throughput, and reliable retry for Internet applications.

The core concept

  • Topic: Message Topic, a level 1 message type to which a producer sends a message.
  • Producer: Also known as message publisher, responsible for producing and sending messages to a Topic.
  • Consumer: Also known as message subscriber, responsible for receiving and consuming messages from a Topic.
  • Messages: A combination of data and (optional) properties that a producer sends to a Topic and eventually to a consumer.
  • Message attributes: Attributes that producers can define for messages, including Message Key and Tag.
  • Group: A class of producers or consumers that typically produce or consume the same type of message and that publish or subscribe logically.

Message sending and Receiving model Message queue RocketMQ version supports a publish and subscribe model, where message producers create topics and send messages to topics. Consumer applications create subscriptions to topics to receive messages from. Communication can be one-to-many (fan out), many-to-one (fan in), and many-to-many.

The specific communication is shown in the figure below. Figure 1. Message sending model

  • Producer cluster: Used to represent message sending applications. A producer cluster contains multiple producer instances, which can be multiple machines, multiple processes of a machine, or multiple producer objects of a process.

A producer cluster can send multiple Topic messages. If a producer unexpectedly goes down while sending a distributed transaction message, the RocketMQ version of the message queue server actively calls back to any machine in the producer cluster to confirm the transaction status.

  • Consumer cluster: Used to represent a consumer messaging application. A consumer cluster contains multiple consumer instances, which can be multiple machines, multiple processes, or multiple consumer objects for a process.

Multiple consumers in a consumer cluster consume messages in an equally distributed manner. If the broadcast mode is set, each instance under the consumer cluster consumes the full amount of data.

A consumer cluster corresponds to a Group ID that can subscribe to multiple topics, as shown in Group 2 in Figure 1. Group and Topic subscriptions can be set directly in the program

Application scenarios

  • Peak peel

Large events such as second kill, red envelope snatching, and enterprise opening can bring high traffic pulses, overload or crash the system due to lack of protection, or affect the user experience due to a large number of failed requests due to excessive restrictions. RocketMQ version of message queue provides peak load filling service to solve this problem.

  • Asynchronous decoupling

Trading system as taobao and Tmall center at the core of the system, order data of every transaction will cause the attention of hundreds of downstream business system, including logistics, shopping cart, integral, flow calculation and analysis, and so on, the overall business system is large and complex, message queue RocketMQ version can realize decoupling asynchronous communication and application, to ensure the continuity of the main business.

  • Order to send and receive

There are many application scenarios that need to ensure the order in daily life, such as the time priority principle in stock trading process, order creation, payment, refund and other processes in trading system, passenger boarding message processing in flight and so on. Similar to the principle of First In First Out (FIFO), the RocketMQ version of message queue provides sequential messages that are guaranteed message FIFO.

  • Distributed transaction consistency

Transaction system, payment red envelope and other scenarios need to ensure the final consistency of data, a large number of distributed transactions of RocketMQ version of message queue are introduced, which can not only realize the decoupling between systems, but also ensure the final consistency of data.

  • Big data analysis

Data generates value in “flow”. Traditional data analysis is mostly based on batch calculation model, but can not achieve real-time data analysis. The combination of RocketMQ version of Ali Cloud message queue and streaming computing engine can easily achieve real-time analysis of business data.

  • Distributed cache synchronization

Tmall 11 big double presses, each breakout wide variety of goods need real-time perception price changes, a large number of concurrent access database in the venue page response time is long, the centralized cache for bandwidth bottleneck, restricted access to change the commodity flow, through the message queue RocketMQ edition build distributed cache, inform you of the changes in the product data in real time.