Kafka consumer offsets out of range with no configured reset policy for partitions

后端 未结 2 572
暗喜
暗喜 2020-12-17 14:26

I\'m receiving exception when start Kafka consumer.

org.apache.kafka.clients.consumer.OffsetOutOfRangeException: Offsets out of range with no confi

2条回答
  •  情深已故
    2020-12-17 15:06

    So you are trying to access offset(29898318) in topic(test) partition(0) which is not available right now.

    There could be two cases for this

    1. Your topic partition 0 may not have those many messages
    2. Your message at offset 29898318 might have already deleted by retention period

    To avoid this you can do one of following:

    1. Set auto.offset.reset config to either earliest or latest . You can find more info regarding this here
    2. You can get smallest offset available for a topic partition by running following Kafka command line tool

    command:

    bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list  --topic  --time -2
    

    Hope this helps!

提交回复
热议问题