Github user HeartSaVioR commented on the issue:

    https://github.com/apache/storm/pull/1919
  
    What I'm referring is the blog doc: 
https://www.confluent.io/blog/tutorial-getting-started-with-the-new-apache-kafka-0.9-consumer-client/
    
    Referring to the doc, "at most once" can be achieved with below code 
snippet *with no autocommit enabled*:
    ```
    try {
      while (running) {
      ConsumerRecords<String, String> records = consumer.poll(1000);
    
      try {
        consumer.commitSync();
        for (ConsumerRecord<String, String> record : records)
          System.out.println(record.offset() + ": " + record.value());
        } catch (CommitFailedException e) {
          // application specific failure handling
        }
      }
    } finally {
      consumer.close();
    }
    ```
    
    It calls commitSync for every poll, not every emit (println in the code).
    Again I'm not familiar with new Kafka API so if we think the above code 
snippet has some other issues I'm completely OK to not providing strict 
at-most-once.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to