summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Powers <dana.powers@rd.io>2015-06-09 09:39:29 -0700
committerDana Powers <dana.powers@rd.io>2015-06-11 23:24:30 -0700
commit513f210ba347adb083108b12a32dca5a4931fe21 (patch)
treeefe7e651ae624be2f1867884081a2ffe02c2182f
parent47bc6a70953980cdf40caa2a4a127ae426d39bb1 (diff)
downloadkafka-python-513f210ba347adb083108b12a32dca5a4931fe21.tar.gz
Add KafkaClient.topics property to get list of known topics
-rw-r--r--kafka/client.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/kafka/client.py b/kafka/client.py
index 1bd8587..cf29eda 100644
--- a/kafka/client.py
+++ b/kafka/client.py
@@ -306,6 +306,10 @@ class KafkaClient(object):
return sorted(list(self.topic_partitions[topic]))
+ @property
+ def topics(self):
+ return list(self.topic_partitions.keys())
+
def ensure_topic_exists(self, topic, timeout = 30):
start_time = time.time()