2013-01-12 37 views
0

I have keep my kafka client offset yet, but the kafka server were delete data in a time delta.How could i get the kafka server's offset in this time?

so i can't get anything when i call the kafka server for data .

How could i get the kafka server's offset in this time?

I just want to get data from now on

我有保存我的卡夫卡客戶端偏移還,但卡夫卡服務器會在一段時間後刪除數據。

因此,當我向卡夫卡服務器要數據時,我不能得到任何東西。

我怎麼能得到卡夫卡服務器現在的偏移量?

我只是想從現在開始獲取數據

回答

0

SimpleConsumer.getOffsetsBefore(topic, partition, time, 1)

time should be kafka.api.OffsetRequest.EarliestTime() , get minimal valid offset