From d2ee3e1bd5f57438a8ba2419e8c9ab41cae70e70 Mon Sep 17 00:00:00 2001 From: Dominic Evans Date: Tue, 27 Sep 2022 11:59:27 +0100 Subject: [PATCH] fix(consumer): default ResetInvalidOffsets to true A number of people have reported issues with the change in default behaviour that was introduced in #2252 and the comment for this configuration value had suggested it would retain the behaviour of previous Sarama versions. This PR puts the default behaviour back to resetting to `c.Consumer.Offsets.Initial` when the server returns an out of range error on a Fetch. Contributes-to: #2342 --- config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.go b/config.go index f6f14f5fc..32a2c0c99 100644 --- a/config.go +++ b/config.go @@ -508,7 +508,7 @@ func NewConfig() *Config { c.Consumer.Group.Rebalance.Timeout = 60 * time.Second c.Consumer.Group.Rebalance.Retry.Max = 4 c.Consumer.Group.Rebalance.Retry.Backoff = 2 * time.Second - c.Consumer.Group.ResetInvalidOffsets = false + c.Consumer.Group.ResetInvalidOffsets = true c.ClientID = defaultClientID c.ChannelBufferSize = 256