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
If you're using brew
like me and wasted a lot of time searching for the infamous kafka-logs
folder, fear no more. (and please do let me know if that works for you and multiple different versions of Homebrew, Kafka etc :) )
You're probably going to find it under:
/usr/local/var/lib/kafka-logs
(this is also helpful for basically every app you install through brew)
1) brew services list
kafka started matbhz /Users/matbhz/Library/LaunchAgents/homebrew.mxcl.kafka.plist
2) Open and read that plist
you found above
3) Find the line defining server.properties
location open it, in my case:
/usr/local/etc/kafka/server.properties
4) Look for the log.dirs
line:
log.dirs=/usr/local/var/lib/kafka-logs
5) Go to that location and delete the logs for the topics you wish
6) Restart Kafka with brew services restart kafka