You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I couldn't find any documentation about this feature, so I hope someone can explain to me why the KafkaConsumerState class that handles the offset committing increments the sent offsets from TopicPartitionOffsetMetadata by one?
Here is the code:
for (TopicPartitionOffsetMetadata t : offsetCommitRequest.getOffsets()) {
if (t.getMetadata() == null) {
offsetMap.put(
new TopicPartition(t.getTopic(), t.getPartition()),
new OffsetAndMetadata(t.getOffset() + 1));
} else {
offsetMap.put(
new TopicPartition(t.getTopic(), t.getPartition()),
new OffsetAndMetadata(t.getOffset() + 1, t.getMetadata()));
}
}
With this behaviour, if you want to commit the offset for a partition you need to send the wanted offset - 1. For example, if I want to set the offset to 0 i need to send this body:
I couldn't find any documentation about this feature, so I hope someone can explain to me why the
KafkaConsumerState
class that handles the offset committing increments the sent offsets fromTopicPartitionOffsetMetadata
by one?Here is the code:
With this behaviour, if you want to commit the offset for a partition you need to send the wanted offset - 1. For example, if I want to set the offset to 0 i need to send this body:
The text was updated successfully, but these errors were encountered: