confluentinc / librdkafka

The Apache Kafka C/C++ library
Other
175 stars 3.14k forks source link

what if the startoffset in consume function less than current beginning offset? #937

Closed ajige closed 7 years ago

ajige commented 7 years ago

Description

This interface: consumer->start(topic, kpartition, startoffset); I want to start from a specific offset. if this offset is lower than the smallest offset currently in Kafka, then this interface will read from the end. Exp, if current data on kafka is of offset from 1000-2000. If I want to start read from 900, then this interface will start read from 2000, since 900 is not on Kakfa. I think the reasonable result should be start from 1000(the smallest offset greater than 900).

how to solve this?

How to reproduce

Checklist

Please provide the following information:

edenhill commented 7 years ago

You can control the behaviour on offset reset with the topic property auto.offset.reset which defaults to largest (latest offset).