zhaoyuguang commented on a change in pull request #5304:
URL: https://github.com/apache/skywalking/pull/5304#discussion_r469647492



##########
File path: 
test/plugin/scenarios/kafka-scenario/src/main/java/test/org/apache/skywalking/apm/testcase/kafka/controller/CaseController.java
##########
@@ -223,29 +235,33 @@ public void run() {
             consumerProperties.put("value.deserializer", 
"org.apache.kafka.common.serialization.StringDeserializer");
             KafkaConsumer<String, String> consumer = new 
KafkaConsumer<>(consumerProperties);
             consumer.subscribe(topicPattern, new 
NoOpConsumerRebalanceListener());
-            int i = 0;
-            while (i++ <= 10) {
-                try {
-                    Thread.sleep(1 * 1000);
-                } catch (InterruptedException e) {
-                }
+            while (true) {
+                if (pollAndInvoke(consumer)) break;
+            }
+            consumer.close();
+        }
 
-                ConsumerRecords<String, String> records = consumer.poll(100);
+        @KafkaPollAndInvoke
+        private boolean pollAndInvoke(KafkaConsumer<String, String> consumer) {

Review comment:
       yes




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to