KafkaConsumer.commitAsync() behavior with a lower offset than previous
问题 How will kafka deal with a call to KafkaConsumer.commitAsync(Map<TopicPartition, OffsetAndMetadata> offsets, OffsetCommitCallback callback) when offset value for a topic is given as a lesser value than a previous invocation? 回答1: It will simply set the offset of the partition to the value you specified,so next time you will consume you message from commitedOffset+1. The javadoc of commitAsync() says: The committed offset should be the next message your application will consume,i.e.