philipnee commented on code in PR #13238:
URL: https://github.com/apache/kafka/pull/13238#discussion_r1106052765


##########
examples/src/main/java/kafka/examples/Consumer.java:
##########
@@ -63,33 +63,36 @@ public Consumer(final String topic,
         this.numMessageToConsume = numMessageToConsume;
         this.messageRemaining = numMessageToConsume;
         this.latch = latch;
+        this.isRunning = true;
     }
 
     KafkaConsumer<Integer, String> get() {
         return consumer;
     }
 
     @Override
+    public void run() {
+        try {
+            do {
+                doWork();
+            } while (isRunning && messageRemaining > 0);
+            System.out.println(groupId + " finished reading " + 
numMessageToConsume + " messages");
+        } catch (Exception ignored) {

Review Comment:
   Hmm good point, I'll add a log there. 



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