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
- Your topic partition
0
may not have those many messages
- Your message at offset
29898318
might have already deleted by retention period
To avoid this you can do one of following:
- Set
auto.offset.reset
config to either earliest
or latest
.
You can find more info regarding this here
- 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 <broker-ip:9092> --topic <topic-name> --time -2
Hope this helps!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…