简体   繁体   中英

Apache Kafka 0.9 Java API Consuming all messages from beginning of topic

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).

Kafka High Level Consumer Fetch All Messages From Topic Using Java API (Equivalent to --from-beginning)

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!

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM