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

前端 未结 4 1712
长发绾君心
长发绾君心 2020-12-24 04:16

I am testing the Kafka High Level Consumer using the ConsumerGroupExample code from the Kafka site. I would like to retrieve all the existing messages on the topic called \

4条回答
  •  难免孤独
    2020-12-24 04:28

     Properties props = new Properties(); 
     props.put("bootstrap.servers", "localhost:9092");
     props.put("auto.offset.reset", "earliest");
     props.put("group.id", UUID.randomUUID().toString());
    

    This properties will help you.

提交回复
热议问题