bootique / bootique-kafka

Provides integration of Kafka client and streams with Bootique
http://bootique.io
Apache License 2.0
4 stars 4 forks source link

Support for "auto.offset.reset" property for consumers #22

Closed andrus closed 5 years ago

andrus commented 5 years ago

A commonly used consumer property is auto.offset.reset and we need to support it in YAML as well as in Bootique ConsumerConfig. The docs from Kafka ConsumerConfig:

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.

Sample:

kafkaclient:
    consumer:
        autoOffsetReset: earliest

Default (per Kafka docs) is "latest".