kafka
kafka copied to clipboard
How to handle OffsetOutOfRange error?
Consumers are not able to consume from the consumer due to OffsetOutOfRange
error.
I am adding recoveryOffset
to recover subscription in case of OffsetOutOfRange.
let consumer = new kafka.GroupConsumer({
connectionString: connectionString,
groupId: groupId,
recoveryOffset: kafka.LATEST_OFFSET,
});
I see this debug log from consumer, but it never updates the offset
2016-10-25T22:05:14.759Z WARN no-kafka-client Updating offset because of OffsetOutOfRange error for kafkamon-pubsub-topic:3
Am I missing something?
I have the same problem.
@rrs120486: Did you find a solution for this?
Not exactly, but I tried setting everything to LATEST_OFFSET.
recoveryOffset: kafka.LATEST_OFFSET,
startingOffset: kafka.LATEST_OFFSET,
time: kafka.LATEST_OFFSET
Also tried adding time: kafka.LATEST_OFFSET
in strategies.
Sometimes it recovers but not everytime.
PS: If I use Java consumer API to consume from same topic state it does that successfully. So most probably something missing in nodeJs implementation.
Which version of Kafka are you running?
I switched to 0.10.1.0 and don't have that problem any more.
I am using 0.9.0. We cannot upgrade our clusters to 0.10.0 as of now. :(