Hey all,

Bit of curiosity that came out of the background to this thread:
http://search-hadoop.com/m/Kafka/uyzND1lLYXb136UfJ1?subj=programmatic+way+to+check+for+topic+existence+

I noticed that KafkaConsumer.java has the ability to list topics (
https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java#L1326),
but KafkaProducer.java doesn't.
It seems like the producer could use its waitOnMetadata call to implement
listTopics(), similar to partitionsFor(),
https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java#L629
https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/Cluster.java#L238
Is there a reason this wasn't added?

Thanks,
Scott

Reply via email to