0

This tutorial here shows the command to consume kafka topic in a terminal.

bin/kafka-console-consumer.sh --topic topic_name --from-beginning --bootstrap-server IP:port

What would be the syntax if I want to start streaming from a specific timestamp, and not --from-beginning. And what format should the timestamp be in (i.e. long epoch or GMT yyyymmdd hhmmss, etc)

Tristan Tran
  • 1,351
  • 1
  • 10
  • 36
  • 1
    relevant - https://stackoverflow.com/questions/60882882/how-to-consume-messages-between-two-timestamps-using-kafka-console-consumer – Yatharth Ranjan Jun 04 '21 at 18:50
  • 1
    Does this answer your question? [How to consume messages between two timestamps using Kafka Console Consumer](https://stackoverflow.com/questions/60882882/how-to-consume-messages-between-two-timestamps-using-kafka-console-consumer) – nipuna Jun 05 '21 at 03:33
  • 1
    It's not possible with the java cli. You need to create a consumer group, use `offsetsForTimes` (mentioned in the other post), commit those offsets to that group, then consume using that group name. Since the group would hold offsets, using the `auto.offset.reset` property flags would be ignored – OneCricketeer Jun 05 '21 at 14:08

0 Answers0