0

Using this library, I was able to get the partition count per topic but not able to get the replication factor. Closest question I could find was this for reference. Any ideas on how to do it?

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Tushar
  • 528
  • 4
  • 20

1 Answers1

3

If you use confluent-kafka library,

  1. Create AdminClient

  2. Then ListTopics

  3. It will return ClusterMetaData

  4. Then, use topics' metadata from ClusterMetaData

  5. TopicMetadata has Partitions' metadata which has replica details

Gibbs
  • 21,904
  • 13
  • 74
  • 138
  • 1
    Thanks a lot, this works! It was also easy getting the `configurations` by using `name` and `value` attributes. – Tushar May 26 '22 at 14:20