How To Fetch Specific Messages in Apache Kafka

Mastering the Kafka console consumer and kafkacat

Giorgos Myrianthous
Better Programming
Published in
4 min readMar 8, 2021

--

Books in a library
Photo by Alfons Morales on Unsplash.

One of the most basic operations one can perform with Kafka is obviously to consume messages from a specific topic. Sometimes we just need to fetch the last batch of messages, but on some other occasions, we might need to consume messages that fall within two offsets or timestamps.

--

--

I strive to build data-intensive systems that are not only functional, but also scalable, cost effective and maintainable over the long term.