majialoong commented on code in PR #22899:
URL: https://github.com/apache/kafka/pull/22899#discussion_r3631409162


##########
tools/src/test/java/org/apache/kafka/tools/other/ReplicationQuotasTestRig.java:
##########
@@ -398,24 +403,20 @@ String json(String... topic) {
         }
 
         KafkaProducer<byte[], byte[]> createProducer() {
-            return TestUtils.createProducer(
-                cluster.bootstrapServers(),
-                1,
-                60 * 1000L,
-                1024L * 1024L,
-                Integer.MAX_VALUE,
-                30 * 1000,
-                0,
-                16384,
-                "none",
-                20 * 1000,
-                SecurityProtocol.PLAINTEXT,
-                Option.empty(),
-                Option.empty(),
-                new ByteArraySerializer(),
-                new ByteArraySerializer(),
-                false
-            );
+            Properties producerProps = new Properties();
+            producerProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, 
cluster.bootstrapServers());
+            producerProps.put(ProducerConfig.ACKS_CONFIG, "1");
+            producerProps.put(ProducerConfig.MAX_BLOCK_MS_CONFIG, 
Long.toString(60 * 1000L));
+            producerProps.put(ProducerConfig.BUFFER_MEMORY_CONFIG, 
Long.toString(1024L * 1024L));
+            producerProps.put(ProducerConfig.RETRIES_CONFIG, 
Integer.toString(Integer.MAX_VALUE));
+            producerProps.put(ProducerConfig.DELIVERY_TIMEOUT_MS_CONFIG, 
Integer.toString(30 * 1000));
+            producerProps.put(ProducerConfig.REQUEST_TIMEOUT_MS_CONFIG, 
Integer.toString(20 * 1000));
+            producerProps.put(ProducerConfig.LINGER_MS_CONFIG, "0");
+            producerProps.put(ProducerConfig.BATCH_SIZE_CONFIG, "16384");
+            producerProps.put(ProducerConfig.COMPRESSION_TYPE_CONFIG, "none");
+            producerProps.put(ProducerConfig.ENABLE_IDEMPOTENCE_CONFIG, 
"false");
+            producerProps.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, 
SecurityProtocol.PLAINTEXT.name());
+            return new KafkaProducer<>(producerProps, new 
ByteArraySerializer(), new ByteArraySerializer());

Review Comment:
   Thanks for the suggestion. Updated.



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