Tushar
Tushar

Reputation: 578

Kafka-python Get replication factor for a topic

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?

Upvotes: 0

Views: 1032

Answers (1)

Gibbs
Gibbs

Reputation: 22956

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

Upvotes: 4

Related Questions