From d83dd5ec1d9bdf91b8ef9e2687fa53d035091c0e Mon Sep 17 00:00:00 2001 From: mhmtszr Date: Mon, 9 Jan 2023 13:27:44 +0300 Subject: [PATCH] Add batch timeout to segmentio produce config --- kafka/producer/producer.go | 1 + 1 file changed, 1 insertion(+) diff --git a/kafka/producer/producer.go b/kafka/producer/producer.go index 73dfd70..e09343e 100644 --- a/kafka/producer/producer.go +++ b/kafka/producer/producer.go @@ -32,6 +32,7 @@ func NewProducer(config *config.Kafka, logger logger.Logger, errorLogger logger. Balancer: &kafka.Hash{}, BatchSize: config.ProducerBatchSize, BatchBytes: math.MaxInt, + BatchTimeout: 500 * time.Microsecond, MaxAttempts: math.MaxInt, ReadTimeout: config.ReadTimeout, WriteTimeout: config.WriteTimeout,