1. What Is the Difference Between an Ordered Message and a Normal Message?
The biggest difference is whether messages are consumed in the exact order that they are created.
Ordered messages are partitioned based on the sharding key. The messages in the same partition are consumed strictly on a first-in-first-out (FIFO) basis, i.e., messages published first will be consumed first. This requirement does not apply to messages in different partitions.
Normal messages are not necessarily consumed in the exact order that they are created.
2. What Is the Difference Between RocketMQ Cluster Consumption and Broadcasting Consumption?
In the cluster mode, a message only needs to be consumed by a consumer in the subscription group cluster.
In the broadcasting mode, a message is delivered to all consumers in the subscription group cluster, and is consumed by each consumer at least once.
3. How Does the System Consume Messages When Multiple Subscription Groups Subscribe to the Same Topic?
The subscription in RocketMQ is not a one-to-one relationship. A topic can be subscribed to by one or more subscription groups, but different subscription groups consume messages without affecting each other. A subscription group maintains its own consumption offset in the current topic. Each message will be received by the subscription group that subscribes to the topic.
4. Is There a Retry Mechanism for a Message Consumption Failure?
In the push consumption mode, RocketMQ will redeliver the message to the retry queue of the subscription group after the consumer fails to consume the message for re-consumption in the specified time. If there are multiple failures, the retry process is repeated. However, if the retry exceeds the limit you have set when creating the subscription group, the message is delivered to the dead-letter queue.
5. What Is the Load Balancing Policy for Message Consumption?
In the push consumption mode, a RocketMQ queue is consumed by only one consumer at a time, and all queues in a topic are allocated to all consumers in the subscription group based on the load balancing policy. By default, messages are evenly distributed.
6. Will Repeated Consumption Occur?
In RocketMQ, repeated consumption may occur. For example, in the Push consumption mode, the local consumer may have actually consumed messages in positions beyond the consumption offset saved by the broker due to network and other problems. If the consumer goes offline and then becomes online at this time, it will pull the messages that have been consumed. You are advised to use a client logic featuring idempotent consumption.