Thanks Akash

On Tue, 1 Oct 2024, 4:17 pm Akash Jain, <akashjain0...@gmail.com> wrote:

> Hello Kiran, Define old. In Kafka when you have a topic with:
>
> 1. cleanup.policy=delete - messages older than than the retention.ms will
> be deleted. For example - if you have a retention of 7 days, all messages
> older than 7 days will be deleted meaning the oldest message that you can
> recover is 7 days old.
> 2. cleanup.policy=compact - latest message for each key is retained, while
> the old messages are deleted. In this case you can recover old messages,
> but only the latest message for each key.
>
> You can write a kafka consumer in a language of your choice, ensure the
> offset.reset policy is set to earliest. You can use console consumer as
> well as shown below to consume all messages (oldest to newest):
>
> kafka-console-consumer --bootstrap-server kafka:9092 --topic topic
> --from-beginning
>

Reply via email to