Re: Reg: DefaultParititioner in Kafka

2016-11-26 Thread Ewen Cheslack-Postava
When a key is available, you generally include it because you want all messages with the same key to always end up in the same partition. This allows all messages with the same key to be processed by the same consumer (e.g. allowing you to aggregate all data for a single user if you key on user

Reg: DefaultParititioner in Kafka

2016-08-29 Thread BigData dev
Hi All, In DefaultPartitioner implementation, when key is null, we get the partition number by modulo of available partitions. Below is the code snippet. if (availablePartitions.size() > 0) { int part = Utils.toPositive(nextValue) % availablePartitions.size(); return