What command shows all of the topics and offsets of partitions in Kafka?

后端 未结 4 1745
春和景丽
春和景丽 2021-01-30 06:47

I\'m looking for a Kafka command that shows all of the topics and offsets of partitions. If it\'s dynamically would be perfect. Right now I\'m using java code to see these infor

4条回答
  •  生来不讨喜
    2021-01-30 06:57

    You might want to try kt. It's also quite faster than the bundled kafka-topics.

    This is the current most complete info description you can get out of a topic with kt:

    kt topic -brokers localhost:9092 -filter my_topic_name -partitions -leaders -replicas

    It also outputs as JSON, so you can pipe it to jq for further flexibility.

提交回复
热议问题