showuon commented on code in PR #12753:
URL: https://github.com/apache/kafka/pull/12753#discussion_r998892134


##########
clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java:
##########
@@ -1581,6 +1581,10 @@ public void commitAsync(final Map<TopicPartition, 
OffsetAndMetadata> offsets, Of
      * is invoked for the same partition more than once, the latest offset 
will be used on the next poll(). Note that
      * you may lose data if this API is arbitrarily used in the middle of 
consumption, to reset the fetch offsets
      *
+     * Note that, since messages are 0-indexed, {@link 
#seekToBeginning(Collection)} should be used to retrieve
+     * the message at offset 0.
+     *
+     * @param offset the last offset which was consumed. The next message 
received will have a higher offset number than this

Review Comment:
   I'm not sure this is correct. We have many tests relying on seek(tp, 0) to 
make sure it starts fetching from offset 0. Ex: 
`BaseConsumerTest#testSimpleConsumption`. Could you find or write a simple test 
to confirm what you described here? Maybe there's a bug. Thanks.



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