• Home
  • Server Management
  • Home
  • Server Management
home/Knowledge Base/Kafka/Kafka Retention Policy Not Working? Here’s What to Check

Kafka Retention Policy Not Working? Here’s What to Check

4 views 0 May 7, 2025 admin

Old messages aren’t getting deleted? Kafka’s retention policy might be misconfigured.

🛠️ Key Settings to Check

  • retention.ms: How long messages are stored.
  • log.retention.bytes: Total log size before old data is deleted.
  • segment.ms & segment.bytes: Segment size before eligible for cleanup.

✅ Troubleshooting Tips

  • Use this to inspect a topic:
kafka-topics.sh --describe --topic <your-topic> --bootstrap-server <broker>
  • Is cleanup policy set to delete?
cleanup.policy=delete
  • Did you restart the broker after config change?
  • Manual deletion only happens when segment files are closed — check segment.ms.
Tags:kafka topic cleanupKafka retention issuesKafka delete.retention.ms

Was this helpful?

Yes  No
Related Articles
  • Kafka Broker Keeps Restarting? Common Causes and Solutions
  • Kafka “Leader Not Available” Error: Root Causes and Fixes
  • Kafka Consumer Lag Explained: What It Is and How to Fix It
  • Fixing “The message is too large” Error in Apache Kafka: A Step-by-Step Guide

Didn't find your answer? Contact Us

Leave A Comment Cancel reply

Kafka
  • Kafka Retention Policy Not Working? Here’s What to Check
  • Fixing “The message is too large” Error in Apache Kafka: A Step-by-Step Guide
  • Kafka Consumer Lag Explained: What It Is and How to Fix It
  • Kafka “Leader Not Available” Error: Root Causes and Fixes
  • Kafka Broker Keeps Restarting? Common Causes and Solutions
All Categories
  • Nginx
  • Linux
  • MySQL
  • Grafana
  • Kubernetes
  • Kafka

  Kafka Consumer Lag Explained: What It Is and How to Fix It

Kafka “Leader Not Available” Error: Root Causes and Fixes  

Manual
  • We we are
  • Contact us
  • Suppliers
Support
  • Live chat
  • Knowledge Base
  • Blog
Security
  • Report Copyright
  • Trademark
  • Security Issue
Manual Head Office
Phone : 765 987-7765
Toll free : 1 999 654-98729
Fax : 250 684-29865
Emergency Help Desk: 7pm-2pm

Center street, 18th floor, New York, NY 1007