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`
   
   ![Screenshot From 2025-01-03 
10-42-00](https://github.com/user-attachments/assets/a3c93e0f-09c1-4dfd-aae7-e616b2dce01d)
   
   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

Reply via email to