Is there a way to delete all the data from a topic or delete the topic before every run?

后端 未结 13 1911
陌清茗
陌清茗 2020-12-12 10:33

Is there a way to delete all the data from a topic or delete the topic before every run?

Can I modify the KafkaConfig.scala file to change the logRetentionHour

13条回答
  •  被撕碎了的回忆
    2020-12-12 11:25

    As I mentioned here Purge Kafka Queue:

    Tested in Kafka 0.8.2, for the quick-start example: First, Add one line to server.properties file under config folder:

    delete.topic.enable=true
    

    then, you can run this command:

    bin/kafka-topics.sh --zookeeper localhost:2181 --delete --topic test
    

提交回复
热议问题