Skip to content

Commit d2169c1

Browse files
committed
limit metadata max age to 1s
1 parent 7ccbcb0 commit d2169c1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kafka/client_config_helper.go

+3
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ func NewKgoConfig(cfg Config, logger *zap.Logger) ([]kgo.Opt, error) {
3434
kgo.ClientID(cfg.ClientID),
3535
kgo.FetchMaxBytes(5 * 1000 * 1000), // 5MB
3636
kgo.MaxConcurrentFetches(10),
37+
// Limit metadata age to mitigate issues with unknown partition/topic
38+
// requests shortly after the creation or changing the partitions.
39+
kgo.MetadataMaxAge(time.Second),
3740
}
3841

3942
// Create Logger

0 commit comments

Comments
 (0)