Reputation: 11
I wish to list all configurations active on a kafka broker. I could see the configurations in server.properties files but that's not all, it doesn't show all configurations. I want to be able to see all configurations, even the default ones. Is this possible? Any pointers in this direction would be greatly appreciated.
Upvotes: 1
Views: 1431
Reputation: 4554
You can achieve that programatically through Kafka AdminClient (I'm using 2.0 FWIW - the interface is still evolving):
final String brokerId = "1";
final ConfigResource cr = new ConfigResource(Type.BROKER, brokerId);
final DescribeConfigsResult dcr = admin.describeConfigs(Arrays.asList(cr));
final Map<ConfigResource, Config> configMap = dcr.all().get();
for (final Config config : configMap.values()) {
for (final ConfigEntry entry : config.entries()) {
System.out.println(entry);
}
}
Each of config entries has a 'source' property that indicates where the property is coming from (in case of broker it's default broker config or per-broker override; for topics there's more possible values).
Upvotes: 1
Reputation: 1373
There is no command which list the current configuration of a kafka broker. However if you want to see all the configuration parameters with there default values and importance it is listed here
https://docs.confluent.io/current/installation/configuration/broker-configs.html
Upvotes: 1