Skip to content

How Kafka keeps messages in order, and when it doesn't

Dev PatelPosted · 1 min read

Kafka guarantees order within a partition, not across a topic. Choose the partition key so that messages which must stay in order share a key.

Order can still break when a producer retries a failed batch while the next one succeeds. Enable idempotent producers, or limit in-flight requests to one, to keep order across retries.

Text by Dev Patel, licensed under CC BY-SA 4.0. You may share and adapt it with credit to the author, under the same licence.

Comments

Loading comments…