Skip to content

Commit

Permalink
limit metadata max age to 1s
Browse files Browse the repository at this point in the history
  • Loading branch information
weeco committed Nov 3, 2024
1 parent 9772a31 commit 4381b18
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kafka/client_config_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ func NewKgoConfig(cfg Config, logger *zap.Logger) ([]kgo.Opt, error) {
kgo.ClientID(cfg.ClientID),
kgo.FetchMaxBytes(5 * 1000 * 1000), // 5MB
kgo.MaxConcurrentFetches(10),
// Limit metadata age to mitigate issues with unknown partition/topic
// requests shortly after the creation or changing the partitions.
kgo.MetadataMaxAge(time.Second),
}

// Create Logger
Expand Down

0 comments on commit 4381b18

Please sign in to comment.