Mingtao, I think you are looking at scala version 2.8.2 . Check your kafka version by kafka_2.8.2-${version} . In 0.8.2 we’ve AdminUtils.topicExists(zkClient, topic) .
Thanks, Harsha On April 20, 2015 at 2:20:27 PM, Mingtao Zhang (mail2ming...@gmail.com) wrote: Hi, I am on Kafka 2.8.2. Looking for a way to check whether topic existed or not in Java. I saw there is a method called listTopics - TopicCommand.listTopics, but the return type is void. Is there an API to check topic existance? (preferable argument: (zkconnect, topic)) Thanks in advance! Best Regards, Mingtao