mjsax commented on code in PR #20540:
URL: https://github.com/apache/kafka/pull/20540#discussion_r2384386540


##########
streams/integration-tests/src/test/java/org/apache/kafka/streams/integration/AdjustStreamThreadCountTest.java:
##########
@@ -121,6 +139,24 @@ public void setup(final TestInfo testInfo) {
         );
     }
 
+    private void produceTestRecords(final String inputTopic, final 
EmbeddedKafkaCluster cluster) {
+        final Properties props = new Properties();
+        props.put("acks", "all");
+        props.put("retries", 1);

Review Comment:
   Why are we lowering retries?



##########
streams/integration-tests/src/test/java/org/apache/kafka/streams/integration/AdjustStreamThreadCountTest.java:
##########
@@ -121,6 +139,24 @@ public void setup(final TestInfo testInfo) {
         );
     }
 
+    private void produceTestRecords(final String inputTopic, final 
EmbeddedKafkaCluster cluster) {
+        final Properties props = new Properties();
+        props.put("acks", "all");
+        props.put("retries", 1);
+        props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, 
cluster.bootstrapServers());
+        props.put(ProducerConfig.CLIENT_ID_CONFIG, "test-client");
+        props.put("key.serializer", 
"org.apache.kafka.common.serialization.StringSerializer");
+        props.put("value.serializer", 
"org.apache.kafka.common.serialization.StringSerializer");
+        final KafkaProducer<String, String> dummyProducer = new 
KafkaProducer<>(props);
+        for (int i = 0; i < 5000; i++) {
+            final String key = "key-" + (i % 50);
+            final String value = "value-" + i;
+            dummyProducer.send(new ProducerRecord<String, String>(inputTopic, 
key, value));
+        }
+        dummyProducer.flush();

Review Comment:
   `close()` will `flush()` automatically. So not necessary to call expliclity.



##########
streams/integration-tests/src/test/java/org/apache/kafka/streams/integration/AdjustStreamThreadCountTest.java:
##########
@@ -88,11 +94,12 @@ public static void startCluster() throws IOException {
 
     @AfterAll
     public static void closeCluster() {
-        CLUSTER.stop();
+        CLUSTER.stop(); 

Review Comment:
   nit: avoid unnecessary whitespace changes



##########
streams/integration-tests/src/test/java/org/apache/kafka/streams/integration/AdjustStreamThreadCountTest.java:
##########
@@ -121,6 +139,24 @@ public void setup(final TestInfo testInfo) {
         );
     }
 
+    private void produceTestRecords(final String inputTopic, final 
EmbeddedKafkaCluster cluster) {
+        final Properties props = new Properties();
+        props.put("acks", "all");
+        props.put("retries", 1);
+        props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, 
cluster.bootstrapServers());
+        props.put(ProducerConfig.CLIENT_ID_CONFIG, "test-client");
+        props.put("key.serializer", 
"org.apache.kafka.common.serialization.StringSerializer");
+        props.put("value.serializer", 
"org.apache.kafka.common.serialization.StringSerializer");
+        final KafkaProducer<String, String> dummyProducer = new 
KafkaProducer<>(props);

Review Comment:
   Would be good to use try-with-resource here.



##########
streams/integration-tests/src/test/java/org/apache/kafka/streams/integration/AdjustStreamThreadCountTest.java:
##########
@@ -121,6 +139,24 @@ public void setup(final TestInfo testInfo) {
         );
     }
 
+    private void produceTestRecords(final String inputTopic, final 
EmbeddedKafkaCluster cluster) {
+        final Properties props = new Properties();
+        props.put("acks", "all");

Review Comment:
   This is the producer default anyway. Can we removed



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