cleanup.policy
The topic property that chooses how old records are removed: delete by retention, compact by key, or both.
In more detail
The default, delete, applies retention.ms and retention.bytes. compact keeps the latest record per key instead.
Example
rpk topic create prices -c cleanup.policy=compactRelated terms
- log compaction — A cleanup mode in which the broker keeps at least the latest record for every key and removes older records with the same key.
- retention — How long data such as backups, logs or snapshots is kept before it is deleted.
Taught in
- The Error Storm That Fixes Itself — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep
- Retention Deletes Files, Not Records — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep
- Forty Minutes To Count Again — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep
- Log Compaction: A Topic As A Table — Apache Kafka & Event Streaming