Bird
Raised Fist0

You want to compact a topic but keep deleted keys for 7 days before removal. Which configuration combination achieves this?

hard🚀 Application Q8 of Q15
Kafka - Monitoring and Operations
You want to compact a topic but keep deleted keys for 7 days before removal. Which configuration combination achieves this?
Acleanup.policy=compact, delete, retention.ms=604800000
Bcleanup.policy=compact, retention.ms=0
Ccleanup.policy=delete, retention.ms=604800000
Dcleanup.policy=compact only
Step-by-Step Solution
Solution:
  1. Step 1: Understand combined cleanup policies

    Setting cleanup.policy=compact,delete enables both compaction and time-based deletion.
  2. Step 2: Use retention.ms for 7 days

    Retention.ms=604800000 (7 days in ms) keeps deleted keys for that time before removal.
  3. Final Answer:

    cleanup.policy=compact, delete, retention.ms=604800000 -> Option A
  4. Quick Check:

    Combine compact and delete with retention.ms for delayed deletion [OK]
Quick Trick: Use cleanup.policy=compact,delete plus retention.ms for delayed deletes [OK]
Common Mistakes:
MISTAKES
  • Using only compact disables time-based deletion
  • Setting retention.ms=0 deletes immediately
  • Using delete policy alone disables compaction

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes