Apache Kafka 4 · Topics

Set a topic's retention

Keep messages for 7 days.

bin/kafka-configs.sh --bootstrap-server localhost:9092 --alter --entity-type topics --entity-name orders --add-config retention.ms=604800000

Official Apache Kafka 4 documentation

More topics commands

All topics commands · Apache Kafka 4 cheatsheet

Was this page helpful?