是否有方法访问中的配置值 server.properties
不直接访问文件本身?
我以为:
kafka-configs.sh --describe --entity-type topics --zookeeper localhost:2181
可能会给我想要的,但我没有看到 server.properties
. 以下是我的主题(我从 kafka-topics.sh
):
Configs for topics:ddos are
Configs for topics:__consumer_offsets are segment.bytes=104857600,cleanup.policy=compact
我想我也会看到全局配置的选项,比如我的默认配置:
log.retention.hours=168
提前谢谢。
1条答案
按热度按时间mwyxok5s1#
由于kafka0.11,您可以使用adminclient
describeConfigs()
检索代理配置的api。例如,检索代理0的配置的框架代码: