get current config in kafka
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
When people ask for the "current config" in Kafka, they usually mean one of two things: the explicit overrides stored for a broker or topic, or the effective value Kafka is actually using after defaults are combined with overrides. Those are related, but they are not the same, and that distinction matters when you are debugging retention, replication, or quota behavior.
What "Current Config" Means in Kafka
Kafka configuration comes from more than one place:
- static broker settings in broker configuration files
- dynamic broker configuration stored in Kafka metadata
- topic-level overrides
- client-side producer and consumer properties
- built-in defaults when nothing else overrides them
That means a single command may not show the whole story. A topic might show no custom retention value and still behave differently because it inherits a broker-level default.
Inspecting Topic and Broker Overrides from the CLI
The normal starting point is kafka-configs.sh. It is useful when you want to inspect topic-level or broker-level configuration that was explicitly set.
Describe a topic configuration:
Describe a broker configuration:
Those commands are especially useful for settings such as retention.ms, cleanup.policy, or throttling limits.
The important nuance is that this view is best understood as "what has been explicitly configured here" rather than "every value Kafka will use in every context." A topic may inherit a broker default even when the topic itself shows no override.
Reading Effective Values with the Admin Client
If you want a programmatic view, the Kafka Admin client is the cleaner approach. It lets you ask Kafka for configuration entries and inspect where each one came from.
The source field is useful because it tells you whether a setting is a default, a topic override, or another source. That is often the missing piece when a value looks wrong in CLI output.
Client Config Is Separate
Producer and consumer configuration is not something Kafka brokers can fully reveal back to you. If a consumer uses max.poll.records=500 or a producer uses acks=all, those are client application settings. To inspect them, you usually need:
- the application properties file
- environment variables
- deployment manifests
- the code that builds the client properties
So if someone says "Kafka is configured this way," always ask whether they mean broker, topic, or client.
Common Pitfalls
- Assuming topic config output shows every effective value, including inherited defaults.
- Forgetting that producer and consumer settings live in the client, not in broker metadata.
- Debugging a retention issue at the topic level when the value is inherited from a broker default.
- Changing configuration without recording whether it was static, dynamic, or application-side.
- Treating "current config" as one thing when Kafka actually has several configuration scopes.
Summary
- Kafka configuration exists at broker, topic, and client levels.
- '
kafka-configs.shis the fastest way to inspect explicit topic and broker settings.' - The Admin client is better when you need to inspect configuration sources programmatically.
- Effective behavior may come from inherited defaults, not just explicit overrides.
- Always distinguish broker config from application-side producer and consumer properties.
Related reading
- Get Kafka compressed message size
- Get last message from kafka consumer console script
- Get last modified date of a Kafka topic
- Get Latest Message for a Confluent Kafka Topic in Python
- Get number of messages in an Amazon SQS Queue
- Get the latest offsets in SSL Enabled Kafka via CMD
- Get topic from kafka message
- get topic from kafka message in spark

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.