I need to be able to consume all messages from a topic, from the beginning. Essentially identical to this StackOverflow query, but updated for Kafka 0.9. (There seem to be relatively few 0.9-specific StackOverflow answers).
0.9 has a sufficiently different API that I don't really know where to start. I can do this from the command-line using a provided bash script, but don't know how to move forward.
Could you please provide me the appropriate methods or a small sample script to get me started? Thank you!
You need to set auto.offset.reset
to earliest
. See https://kafka.apache.org/documentation.html#newconsumerconfigs
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.