chia7712 commented on code in PR #23021:
URL: https://github.com/apache/kafka/pull/23021#discussion_r3721705963


##########
connect/mirror/src/test/java/org/apache/kafka/connect/mirror/integration/MirrorConnectorsIntegrationBaseTest.java:
##########
@@ -1326,8 +1323,9 @@ protected void produceMessages(Producer<byte[], byte[]> 
producer, List<ProducerR
         Timer timer = Time.SYSTEM.timer(RECORD_PRODUCE_DURATION_MS);
 
         try {
-            for (ProducerRecord<byte[], byte[]> record : records) {
-                producer.send(record).get(timer.remainingMs(), 
TimeUnit.MILLISECONDS);
+            var futures = records.stream().map(producer::send).toList();
+            for (var future : futures) {
+                future.get(timer.remainingMs(), TimeUnit.MILLISECONDS);

Review Comment:
   Would you mind applying this timer-based timeout to other similar methods as 
well? 



-- 
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: [email protected]

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

Reply via email to