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


##########
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);

Review Comment:
   you are right, we don't need this flag 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