Kafka garante ordenação dentro de uma partição, mas não entre partições — um conceito crucial. Para obter ordenação de eventos relacionados, você os roteia para a mesma partição (via a mesma chave). Compreender ordenação é importante para a correção.
Ordenação por partição
Kafka guarantees:
✓ ORDER WITHIN a partition → events in a partition are strictly ordered (by offset);
consumers read them in order
✗ NO order ACROSS partitions → events in different partitions have no relative order
guarantee (they're processed in parallel by different consumers)
→ this is a FUNDAMENTAL Kafka property (and a common source of misunderstanding)
