Description
While working on KIP-794, I noticed that DefaultStreamPartitioner does not call .onNewBatch. The "sticky" DefaultStreamPartitioner introduced as a result of https://issues.apache.org/jira/browse/KAFKA-8601 requires .onNewBatch call in order to switch to a new partitions for unkeyed messages, just calling .partition would return the same "sticky" partition chosen during the first call to .partition. The partition doesn't change even if the partition leader is unavailable.
Ideally, for unkeyed messages the DefaultStreamPartitioner should take advantage of the new built-in partitioning logic introduced in https://github.com/apache/kafka/pull/12049. Perhaps, it could return null partition for unkeyed message, so that KafkaProducer could run built-in partitioning logic.
Attachments
Issue Links
- links to