Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't set Kafka retention policy to both compact and delete

Tags:

apache-kafka

According to the below links I'm supposed to be able to set the retention.policy value to "compact,delete".

https://issues.apache.org/jira/browse/KAFKA-4015

https://cwiki.apache.org/confluence/display/KAFKA/KIP-71%3A+Enable+log+compaction+and+deletion+to+co-exist

However when I try to alter the retention policy by running:

./kafka-configs.sh --zookeeper $KAFKAZKHOSTS  --entity-type
 topics --alter --add-config cleanup.policy=compact,delete --entity-name topicname

I'm getting the following error:

requirement failed: Invalid entity config: all configs to be added must be in the format "key=val".
like image 332
emirhosseini Avatar asked Sep 01 '25 16:09

emirhosseini


1 Answers

--add-config cleanup.policy=[compact,delete]

like image 137
wuji Avatar answered Sep 04 '25 07:09

wuji