chia7712 commented on code in PR #18336: URL: https://github.com/apache/kafka/pull/18336#discussion_r1901429698
########## clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java: ########## @@ -266,8 +270,7 @@ * for (ConsumerRecord<String, String> record : partitionRecords) { * System.out.println(record.offset() + ": " + record.value()); * } - * long lastOffset = partitionRecords.get(partitionRecords.size() - 1).offset(); - * consumer.commitSync(Collections.singletonMap(partition, new OffsetAndMetadata(lastOffset + 1))); + * consumer.commitSync(Collections.singletonMap(partition, partitionRecords.nextOffsets().get(partition)); Review Comment: @mjsax Could you please take a look at following attachment? the type of `partitionRecords` is `List<ConsumerRecord<String, String>>` rather than `ConsumerRecords`  btw, it miss a `)` also. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org