Skip to content

Commit 513f210

Browse files
author
Dana Powers
committed
Add KafkaClient.topics property to get list of known topics
1 parent 47bc6a7 commit 513f210

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

kafka/client.py

+4
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,10 @@ def get_partition_ids_for_topic(self, topic):
306306

307307
return sorted(list(self.topic_partitions[topic]))
308308

309+
@property
310+
def topics(self):
311+
return list(self.topic_partitions.keys())
312+
309313
def ensure_topic_exists(self, topic, timeout = 30):
310314
start_time = time.time()
311315

0 commit comments

Comments
 (0)