API Testing · Senior · Question 22 of 75
Why test message ordering assumptions in async APIs?
- 1Events can arrive out of order across partitions or retries
- 2Ordering affects only how fast messages are consumed
- 3Brokers always deliver messages in alphabetical order
Show the answer
Correct answer: Events can arrive out of order across partitions or retries
Explanation
"Order shipped" may arrive before "order paid". Consumers need version checks or ordering keys, and tests should send events in odd orders.