The queue hands messages out in order, but with three consumers they can be processed and finish in any order
"The queue hands messages out in order, but with three consumers they can be processed and finish in any order" is right. A queue delivers in FIFO order (first in, first out). But here the messages are spread across competing consumers. A slow consumer or a requeued message lets a later event finish first.
"Events are always processed in order, because the queue is FIFO" is wrong: FIFO covers delivery, not processing. "RabbitMQ routes all messages for one account to the same consumer" is also wrong. Plain RabbitMQ queues have no idea of an entity key.
For strict order, do one of these:
• Use a single active consumer.
• Split messages into one queue per key, with one consumer each. The consistent-hash exchange can do this split.
Read more