Update apache-kafka-2/src/main/java/com/baeldung/kafka/message/ordering/ProducerConfigurations.java

Co-authored-by: Liam Williams <liam.williams@zoho.com>
This commit is contained in:
Amol Gote 2023-10-15 15:58:33 -04:00 committed by GitHub
parent f8ea1db5cc
commit 463e45d025
1 changed files with 1 additions and 1 deletions

View File

@ -11,7 +11,7 @@ public class ProducerConfigurations {
props.put("bootstrap.servers", "localhost:9092"); props.put("bootstrap.servers", "localhost:9092");
props.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer"); props.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer");
props.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer"); props.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer");
props.put("max.in.flight.requests.per.connection", "1"); props.put(ProducerConfig.MAX_IN_FLIGHT_REQUESTS_PER_CONNECTION, "1");
props.put(ProducerConfig.BATCH_SIZE_CONFIG, "16384"); props.put(ProducerConfig.BATCH_SIZE_CONFIG, "16384");
props.put(ProducerConfig.LINGER_MS_CONFIG, "5"); props.put(ProducerConfig.LINGER_MS_CONFIG, "5");
KafkaProducer<String, String> producer = new KafkaProducer<>(props); KafkaProducer<String, String> producer = new KafkaProducer<>(props);