mjsax commented on code in PR #18336:
URL: https://github.com/apache/kafka/pull/18336#discussion_r1902062099


##########
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:
   Thanks for sanity checking... I did mix up the variable names.



-- 
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