Delete topic in Kafka 0.8.1.1

后端 未结 14 1625
栀梦
栀梦 2020-11-30 19:26

I need to delete the topic test in Apache Kafka 0.8.1.1.

As expressed in the documentation here, I have executed:

bin/kafka-topics.sh --         


        
14条回答
  •  醉话见心
    2020-11-30 19:53

    Andrea is correct. we can do it using command line.

    And we still can program it, by

    ZkClient zkClient = new ZkClient("localhost:2181", 10000);
    zkClient.deleteRecursive(ZkUtils.getTopicPath("test2"));
    

    Actually I do not recommend you delete topic on Kafka 0.8.1.1. I can delete this topic by this method, but if you check log for zookeeper, deletion mess it up.

提交回复
热议问题