Make Kafka Topic Log Retention Permanent

2019-04-06 14:27发布

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

2条回答
狗以群分
2楼-- · 2019-04-06 15:10

These special topics are compacted topics. This means they are made up of keyed messages and only keep the list recent key. A full write here. This is probably what you want for infinite retention time in most cases.

查看更多
等我变得足够好
3楼-- · 2019-04-06 15:11

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

查看更多
登录 后发表回答