retention.ms

The topic property that sets the maximum age, in milliseconds, of records before their segment becomes eligible for deletion.

In more detail

Kafka's default is 604800000, which is seven days. Retention time is a minimum rather than an exact moment, because the broker only deletes a segment once it is closed and every record in it is old enough.

Example

rpk topic alter-config events -s retention.ms=3600000

Related terms

Taught in

References

Certification courses