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


##########
examples/src/main/java/kafka/examples/Consumer.java:
##########
@@ -91,9 +99,13 @@ public void run() {
                     // we can't recover from these exceptions
                     Utils.printErr(e.getMessage());
                     shutdown();
+                } catch (OffsetOutOfRangeException | 
NoOffsetForPartitionException e) {
+                    // invalid or no offset found without auto.reset.policy
+                    Utils.printOut("Invalid or no offset found, using latest");
+                    consumer.seekToEnd(emptyList());

Review Comment:
   Yes, I agree it won't have different result in this demo case. But I think 
we should provide a good example here to let users know, in their client 
application, they should use `consumer.seekToEnd(e.partitions())` to seek for 
the affected partitions only, not all of the assigned partitions. Does that 
make sense?



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