Kafka-python 获取主题的复制因子

Kafka-python Get replication factor for a topic

使用此 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 供参考。 有什么想法吗?

如果您使用 confluent-kafka 库,

  1. 创建AdminClient

  2. 然后ListTopics

  3. 会returnClusterMetaData

  4. 然后,使用来自 ClusterMetaData

    topics' metadata
  5. 主题元数据有 Partitions' metadata which has replica details