What determines Kafka consumer offset?

前端 未结 3 1100
囚心锁ツ
囚心锁ツ 2020-11-27 09:51

I am relatively new to Kafka. I have done a bit of experimenting with it, but a few things are unclear to me regarding consumer offset. From what I have understood so far, w

3条回答
  •  佛祖请我去吃肉
    2020-11-27 10:18

    Just an update: From Kafka 0.9 and forth, Kafka is using a new Java version of the consumer and the auto.offset.reset parameter names have changed; From the manual:

    What to do when there is no initial offset in Kafka or if the current offset does not exist any more on the server (e.g. because that data has been deleted):

    earliest: automatically reset the offset to the earliest offset

    latest: automatically reset the offset to the latest offset

    none: throw exception to the consumer if no previous offset is found for the consumer's group

    anything else: throw exception to the consumer.

    I spent some time to find this after checking the accepted answer, so I thought it might be useful for the community to post it.

提交回复
热议问题