Purge Kafka Topic

后端 未结 19 2400
慢半拍i
慢半拍i 2020-11-28 00:06

Is there a way to purge the topic in kafka?

I pushed a message that was too big into a kafka message topic on my local machine, now I\'m getting an

19条回答
  •  情书的邮戳
    2020-11-28 00:52

    While the accepted answer is correct, that method has been deprecated. Topic configuration should now be done via kafka-configs.

    kafka-configs --zookeeper localhost:2181 --entity-type topics --alter --add-config retention.ms=1000 --entity-name MyTopic
    

    Configurations set via this method can be displayed with the command

    kafka-configs --zookeeper localhost:2181 --entity-type topics --describe --entity-name MyTopic
    

提交回复
热议问题