Child pages
  • Finding Topic and Partition Leader
Skip to end of metadata
Go to start of metadata

Finding the Topic and Partition Leader data for a cluster 

Finding all the Topics, Partitions, Partition Leaders and Replicas for a cluster requires using a TopicMetaDataRequest in the SimpleConsumer.

The following code will connect to a Broker and print out all the Topics, Partitions, which Broker is a the leader and which Brokers are replicas for the Partitions.

By passing an empty List<String> to the TopicMetadatRequest you are asking Kafka to return data on all Topics.

To find the details for a specific Topic, add the name to the List<String> passed to the TopicMetadataRequest:

  • No labels

1 Comment

  1. Anonymous

    I just wanted to comment on your blog and say I really enjoyed reading your blog here. It was very informative and I also digg the way you write! Keep it up and I'll be back soon to find out more mate.Car GPS