Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-3191

Improve offset committing JavaDoc in KafkaConsumer

    XMLWordPrintableJSON

Details

    Description

      http://www.confluent.io/blog/tutorial-getting-started-with-the-new-apache-kafka-0.9-consumer-client includes some great examples of how to manage offset commits in Kafka 0.9.

      It is currently unclear from the JavaDoc that the following is expected:

      consumer.commitSync(Collections.singletonMap(record.partition(), new
      OffsetAndMetadata(record.offset() + 1)));
      

      The committed offset should always be the offset of the next message that
      your application will read.

      This information should be incorporated into the existing JavaDoc to make it clearer.

      Attachments

        Activity

          People

            adam.kunicki Adam Kunicki
            adam.kunicki Adam Kunicki
            Gwen Shapira Gwen Shapira
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: