Message Flow

Producer → Kafka Partition Flow

When a producer sends a message to a Kafka topic, the partitioner decides which partition it lands on. Messages with a key are hashed — hash(key) % partitionCount — ensuring the same key always reaches the same partition. Messages with a null key use the sticky partitioner, round-robining across partitions in batches.

This simulator visualizes how different key strategies affect partition distribution and message ordering in real time.

Partitions:
Sticky Partition: Random assignment (round-robin across partitions)

Producer

P0
0
P1
0
P2
0
Message History

No messages sent

Partition Assignment Strategies
Null key: Uses sticky partitioner — random round-robin, batches accumulate on one partition before switching
Fixed key: Default partitioner — hash(key) % partitionCount ensures messages with same key always go to same partition (ordering guarantee)
Random key: Uniform sticky partitioner — random key per message but consistent via hash (same key = same partition)