Distributed Message Service RocketMQ

Ordered Consumption or Unordered Consumption

2024-07-08 08:56:59

You are advised to select unordered messages in applicable business scenarios, or to convert ordered messages to unordered ones if such conversion is acceptable.

Advantages of Unordered Messages:

1. A producer can send messages to the same topic through multiple processes and threads to achieve better performance.

2. A consumer can simultaneously consume messages through multiple processes and threads, improving performance.

3. The cluster failover feature does not require an automatic master/slave switchover, during which the service will be interrupted.

(1) When a broker node in the cluster fails, messages can still be produced, and are sent to other nodes after failover.

(2) When a broker node in the cluster is faulty, other nodes can still consume messages, and this node can resume consumption after the fault is rectified.

(3) Dynamic capacity expansion is available.

Disadvantages of Ordered Message:

1. When a node fails for ordered messages, the number of queues will not change, but production and consumption will be faulty until the faulty node recovers.

2. For ordered messages, all the messages must be consumed and the client must be stopped before capacity expansion.


kxa9QgyewnAD