Make Kafka Topic Log Retention Permanent

拟墨画扇 提交于 2019-11-30 02:51:10

问题


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


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/39735036/make-kafka-topic-log-retention-permanent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!