Make Kafka Topic Log Retention Permanent

user1077071 picture user1077071 · Sep 28, 2016 · Viewed 10.8k times · Source

I am writing log messages into a Kafka Topic and I want the retention of this topic to be permanent. I have seen in Kafka and Kafka Connect (_schemas, connect-configs, connect-status, connect-offsets, etc) that there are special topics that are not deleted by the log retention time. How do I enforce a topic to be like these other special topics? Is it the naming convention or some other properties?

Thanks

Answer

highlycaffeinated picture highlycaffeinated · Sep 28, 2016

If you want to retain all topics forever, you can set both log.retention.hours and log.retention.bytes to -1.