java - Kafka Consumer Properties to read from the maximum offset -
i have written java kafka consumer. make sure how explicitly ensure once kafka consumer started reads messages sent producer time onwards i.e. should not read messages have been sent producer kafka. can explain how ensure this? :
here snippet of properties use
properties properties = new properties(); properties.put("zookeeper.connect", zookeeperhost); properties.put("group.id", group); properties.put("auto.offset.reset","largest"); consumerconfig consumerconfig = new consumerconfig(properties); consumerconnector = consumer.createjavaconsumerconnector(consumerconfig);
update sept14:
i using following properties, seems consumer still reads beginning @ times, can tell me what's wrong now?
i using kafka version 0.8.2
properties.put("auto.offset.reset","largest"); properties.put("auto.commit.enable","false");
based on answers above, seems correct mechanism follows setting properties of consumer:
properties.put("auto.offset.reset","largest"); properties.put("auto.commit.enable","false");
this ensures reading maximum offset
Comments
Post a Comment