...

/

Message Delivery: Ordered Messages

Message Delivery: Ordered Messages

Learn the importance of order message delivery guarantee in event processing.

As with delivery guarantees, the order we will receive events comes with its own scale of guarantees of order. We can quickly find ourselves in a difficult situation if we listen to our vendor who promises that their product always delivers messages in the order they were published and later learn we are processing ProductRemoved events before the corresponding ProductAdded event.

The number of consumers we use and how we use them can have a huge impact on ordering.

  • Single consumer: A single consumer subscribed to a first-in, first-out (FIFO) queue will receive messages in the order that they were published, as depicted in the following diagram:

Press + to interact
Single consumer receiving messages in order from a FIFO queue
Single consumer receiving messages in order from a FIFO queue

If our system were to publish messages at or below the rate it consumes them, then a single consumer would keep up ...