This topic introduces the MQ related terms to help you better understand and use MQ.
Message Queue (MQ), a commercial messaging middleware of Alibaba, is a key product in enterprise Internet architecture. Powered on the highly available distributed cluster technology, it provides a series of messaging cloud services including message production and consumption, scheduled and delayed messages，message tracing, messaging statistics and monitoring.
A message is a carrier for transmitting information in MQ.
A message ID is the global unique identifier for a message, which is automatically generated by the MQ system.
A message key is a unique identifier of the message’s business logic, which is set by the message producer.
A Topic is used to classify messages. It is the first-level classification.
A Tag is used to further classifify the messages under a Topic. It is the second-level classification.
A Producer, also known as a message publisher, is responsible for producing and sending messages.
An identifier for a group of Producers that produce and send the same type of messages, where the sending logics are the same.
An object instance of a Producer. Different Producer instances can be run in different processes or on different machines. The Producer instance’s thread is safe and can be shared between multiple threads in the same process.
A Consumer, also known as a message subscriber, receives and consumes messages.
An identifier for a group of Consumers which receive and consume the same type of messages, where the consumption logics are the same.
An object instance of a Consumer. Different Consumer instances can be run in different processes or on different machines. A thread pool is configured in a Consumer instance for message consumption.
All the Consumers identified by the same Consumer ID evenly share the messages. For example, there are 9 messages under a certain Topic, and 3 Consumer instances identified by the same Consumer ID, then each Consumer instance consumes 3 messages under the clustering consumption mode.
Each of the Consumers identified by the same Consumer ID consumes all the messages once. For example, there are 9 messages under a certain Topic, and 3 Consumer instances identified by the same Consumer ID, then each Consumer instance consumes the 9 messages once under the broadcasting consumption mode.
A producer sends a message to MQ server, expecting the message to be delivered at a specified time in the future. The message is a scheduled message.
A producer sends a message to MQ server, expecting the message to be delivered after a specified period of time. The message is a delayed message.
Transactional messages follow a distributed transaction processing mechanism similar to X/Open XA to ensure global transactional consistency.
Ordered message is a type of message that is delivered and consumed in order, and it is classified into globally ordered message and partitionally ordered message.
For a specified Topic, the client sends the messages in order.
For a specified Topic, the client receives messages in order, i.e., the message sent first must be received first by the client.
Globally Ordered Message
For a specified Topic, all messages are delivered and consumed in strict First-In-First-Out (FIFO) order.
Partitionally Ordered Message
For a specified Topic, all messages are sharded into partitions by sharding keys. Messages in the same partition are delivered and consumed in strict FIFO order. Sharding key is used in ordered message to distinguish different partitions, which is completely different from the key used in normal messages.
Message accumulation refers to the storage of unconsumed messages in an MQ server after a producer has already sent messages to the MQ server, and the consumer cannot correctly consume all the messages in a short time due to the limited consumption ability.
A Producer has sent the messages to the MQ server, but the Consumer is not able to consume the messages in time due to its limited consumption capability, so they are stored in the MQ server. This is called message accumulation.
A Consumer can filter messages according to Tags to receive only the message type that he wants. Message filtering is done on the MQ server.
Message trace refers to the complete route information of a message from its issuance by the producer and through the MQ server to its consumption by a consumer, consisting of the time, location and other information on every node. It is very helpful in troubleshooting.
Reset Consumer Offset
With the timeline as coordinates, reset the consumer offset of a Topic subscribed by a message consumer over the time span specified for persistent message storage (three days by default), where the consumer may receive a message sent by the message producer to the MQ server after a set time point.
Within the allowed message storage time (3 days by default), you can reset a Consumer’s message consuming progress for its subscribed Topics by point of time. After the reset, the Consumer will receive the messages that are sent to the MQ server after the specified point of time.