From 80b180c1ffc5b1f0d917d17d80a4c896c866ecfb Mon Sep 17 00:00:00 2001 From: Cassondra Foesch Date: Tue, 27 Feb 2024 14:37:11 +0000 Subject: [PATCH] fix: message.max.bytes should default to 1048576 (#2804) Sarama should match the max.request.size default from the Java producer config. https://kafka.apache.org/documentation/#producerconfigs_max.request.size Note that the server has its own limit on the record batch size which defaults to slightly higher than this, but is configurable and can also be set per topic too. https://kafka.apache.org/documentation/#brokerconfigs_message.max.bytes Co-authored-by: Cassondra Foesch Signed-off-by: Dominic Evans --- config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.go b/config.go index ad970a3f0..facf76643 100644 --- a/config.go +++ b/config.go @@ -523,7 +523,7 @@ func NewConfig() *Config { c.Metadata.Full = true c.Metadata.AllowAutoTopicCreation = true - c.Producer.MaxMessageBytes = 1000000 + c.Producer.MaxMessageBytes = 1024 * 1024 c.Producer.RequiredAcks = WaitForLocal c.Producer.Timeout = 10 * time.Second c.Producer.Partitioner = NewHashPartitioner