使用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 會導致資料重新消費
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/397591.html
標籤:其他
上一篇:Flink寫入Hbase
