Partition Strategy
By default, if you don't provide the key (by not sending ProducerRecord
instead send the String
itself or not using the override methods), it will use the default partitioning strategy.
Default partitioning strategy as of Kafka 2.4 is Sticky (stick to 1 partition for a batch).
Otherwise if you provide the key, it will partition by key.