Update TTL for a topic so records stay in the topic for 10 days. Do this for this topic only. Leave all other topics TTL's the same, current configuration
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
you have already asked about that and I have already replied here : Update TTL for a particular topic in kafka using Java
or maybe are you asking to do that not in Java but just using Kafka tools ? In this case there is the kafka-topics.sh command line tool for doing that using the --alter option.
bin/kafka-topics.sh --alter --zookeeper localhost:2181 --topic test --config retention.ms=10000
Because altering using kafka-topics script could be removed in next release, you should use the kafka-configs script :
bin/kafka-configs.sh --zookeeper localhost:2181 --alter --entity-type topics --entity-name test --add-config retention.ms=5000
标签:
apache-kafka