conduktor.io ↗

metadata.max.age.ms — Kafka Consumer Configuration

The period of time in milliseconds after which we force a refresh of metadata even if we haven't seen any partition leadership changes to proactively discover any new brokers or partitions..

Description

The period of time in milliseconds after which we force a refresh of metadata even if we haven't seen any partition leadership changes to proactively discover any new brokers or partitions.

Default Values by Kafka Version

Kafka VersionDefault Value
0.9.0300000
0.10.0300000
0.10.1300000
0.10.2300000
0.11.0300000
1.0300000
1.1300000
2.0300000
2.1300000
2.2300000
2.3300000
2.4300000
2.5300000
2.6300000 (5 minutes)
2.7300000 (5 minutes)
2.8300000 (5 minutes)
3.0300000 (5 minutes)
3.1300000 (5 minutes)
3.2300000 (5 minutes)
3.3300000 (5 minutes)
3.4300000 (5 minutes)
3.5300000 (5 minutes)
3.6300000 (5 minutes)
3.7300000 (5 minutes)
3.8300000 (5 minutes)
3.9300000 (5 minutes)
4.0300000 (5 minutes)
4.1300000 (5 minutes)
4.2300000 (5 minutes)

Tuning Recommendation

ProfileRecommendedWhy
producer / throughput300000The 5-minute metadata refresh interval is optimal for throughput: frequent refreshes (e.g., 30s) add metadata overhead on large clusters, while very infrequent refreshes delay routing updates after leader elections.
producer / latency30000Refreshing metadata every 30s instead of 5 minutes reduces the periodic background refresh interval; this shortens the window for stale-leader routing after a partition election. Note that errors like NOT_LEADER_OR_FOLLOWER already trigger an immediate refresh, so the practical impact is mainly on reducing the burst of retries before the first error-triggered refresh.

Related Configs

metadata.max.idle.ms

Manage Kafka configs across all your clusters with Conduktor Console — view, compare, and update configurations in one place.