Chia-Ping Tsai created KAFKA-21155:
--------------------------------------
Summary: Document that the records map passed to ConsumerRecords
must not contain empty lists
Key: KAFKA-21155
URL: https://issues.apache.org/jira/browse/KAFKA-21155
Project: Kafka
Issue Type: Improvement
Reporter: Chia-Ping Tsai
Assignee: Chia-Ping Tsai
{code:java}
public boolean isEmpty() {
return records.isEmpty();
}
{code}
The empty list will make {{ConsumerRecords#isEmpty}} return false, and
{{partitions()}} will include a partition with no records. I have checked that
both classic and async consumers follow the rule.
[https://github.com/apache/kafka/pull/23532] will fix the issue in share
consumer.
I was thinking of modifying {{{}isEmpty{}}}, but it may introduce an unexpected
breaking change, and the constructor is public so interceptors can build
{{ConsumerRecords}} too. That is to say ... let's update the docs instead 🙂
--
This message was sent by Atlassian Jira
(v8.20.10#820010)