Amit Bhaira
Amit Bhaira

Reputation: 1767

what is the significance of log retention period in kafka?

If I have log retention period set to 2 hours for a partitions than after 2hrs only the consumed messages will be purged or all the messages whether consumed or not, will be purged?

Upvotes: 5

Views: 4041

Answers (1)

user2720864
user2720864

Reputation: 8171

Once the retention hour is over all the messages will be discarded no matter consumed or not. Here is a brief note from the official documentation

The Kafka cluster retains all published messages—whether or not they have been consumed—for a configurable period of time. For example if the log retention is set to two days, then for the two days after a message is published it is available for consumption, after which it will be discarded to free up space. Kafka's performance is effectively constant with respect to data size so retaining lots of data is not a problem.

Upvotes: 7

Related Questions