I have a topic and there are some messages in it. A part of messages was deleted after retention time was out including a message on which offset points and many messages after it.
How to find the oldest existing message in the topic? I heard there is some method in API but I can't find it. If someone knows how to do it, please help, 'cause I'm already tortured by searching it in the documentation. Thanks in advance.
You can use kafka-console-consumer with --max-messages 1 and --from-beginning in order to fetch the oldest message:
kafka-console-consumer --bootstrap-server localhost:9092 --topic topic_name --from-beginning --max-messages 1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With