Github user revans2 commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1919#discussion_r100546788
  
    --- Diff: docs/storm-kafka-client.md ---
    @@ -345,3 +345,27 @@ Currently the Kafka spout has has the following 
default values, which have shown
     * offset.commit.period.ms = 30000   (30s)
     * max.uncommitted.offsets = 10000000
     <br/>
    +
    +# Kafka AutoCommitMode 
    +
    +If reliability isn't important to you -- that is, you don't care about 
losing tuples in failure situations --, and want to remove the overhead of 
tuple tracking, then you can run a KafkaSpout with AutoCommitMode.
    +
    +To enable it, you need to:
    +* set Config.TOPOLOGY_ACKERS to 0;
    +* enable *AutoCommitMode* in Kafka consumer configuration; 
    +
    +Here's one example to set AutoCommitMode in KafkaSpout:
    +```java
    +Map<String, Object> props = new HashMap<String, Object>();
    +props.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, "true");
    +KafkaSpoutConfig<String, String> kafkaConf = KafkaSpoutConfig
    +           .builder(String bootstrapServers, String ... topics)
    +           .setProp(props)
    --- End diff --
    
    nit: set prop works with a key and a value, so it would be smaller to just 
do
    ```
    KafkaSpoutConfig<String, String> kafkaConf = KafkaSpoutConfig
                .builder(String bootstrapServers, String ... topics)
                .setProp(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, "true")
                    
.setFirstPollOffsetStrategy(FirstPollOffsetStrategy.EARLIEST)
                .build();
    ```



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