使用kafka版本 0.10.0.0 进行消息消费时发现每隔一天会出现重复消费,经查阅与offsets.retention.minutes配置有关
在kafka 新版本中官方文档对该配置的解释为:
After a consumer group loses all its consumers (i.e. becomes empty) its offsets will be kept for this retention period before getting discarded. For standalone consumers (using manual assignment), offsets will be expired after the time of last commit plus this retention period.
意思是消费组所有消费者都下线kafka会对消费位移记录保持 offsets.retention.minutes 配置的值的时间,此时间后会删除消费位移记录,此时消费者重新上线进行消费会从最开始的记录开始消费出现重复消费
但在0.10.0.0版本该值的官方解释为:
Log retention window in minutes for offsets topic
经测试该版本的该值的表现与新版本存在差异
测试发现就算消费组中消费者在线,但是持续 offsets.retention.minutes没有新数据消费,kafka定期(offsets.retention.check.interval.ms)会去删除过期位移,此时会删除最新的消费位移记录,若此时发生分区balance 会导致数据重新消费
1028

被折叠的 条评论
为什么被折叠?



