How to get topic list from kafka server in Java

后端 未结 6 504

I am using kafka 0.8 version and very much new to it.

I want to know the list of topics created in kafka server along with it\'s metadata.

6条回答
  •  生来不讨喜
    2020-12-29 07:21

    I think this is the best way:

    ZkClient zkClient = new ZkClient("zkHost:zkPort");
    List topics = JavaConversions.asJavaList(ZkUtils.getAllTopics(zkClient));
    

提交回复
热议问题