두 가지 방법이 있다.

topic 이름은 MyTopic 이라고 하자.

 

 

 

 

 

 

< topic 내의 메세지 삭제 방법 >

 

 

삭제 주기를 1초 등으로 줄여서 삭제하고, 다시 늘리면 됨.

 

bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic MyTopic --config retention.ms=1000

 

1초 : 1000ms

10초 : 10000ms

 

 

 

 

< topic 자체를 삭제한 후 다시 생성하는 방법 >

 

 

server.properties 에 delete.topic.enable=true 추가

 

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

 

 

 

 

+ Recent posts