fgeller / kt

Kafka command line tool that likes JSON
MIT License
950 stars 100 forks source link

Get list of topics #106

Closed tetafro closed 4 years ago

tetafro commented 4 years ago

Is there any way of getting list of topics (and other metadata) from Kafka using kt? Something like in kafkacat:

$ kafkacat -L -b kafka01.example.com:9092,kafka02.example.com:9092,kafka03.example.com:9092

Metadata for all topics (from broker 2: kafka02.example.com:9092/2):
 3 brokers:
  broker 2 at kafka02.example.com:9092
  broker 3 at kafka03.example.com:9092
  broker 1 at kafka01.example.com:9092
 13 topics:
  topic "topic01" with 64 partitions:
    partition 0, leader 3, replicas: 3,1,2, isrs: 1,2,3
...
dangogh commented 4 years ago

like this? It doesn't show the other data, but does list topics...

./kt topic
{
  "name": "__consumer_offsets"
}
{
  "name": "_schemas"
}
{
  "name":"topic01"
}
tetafro commented 4 years ago

@dangogh thank you!