[#9] poll 작업이 완료되었다고 판단하는 기준 수정 #10
@ -22,7 +22,7 @@ public class RecordProcessor {
|
|||||||
private long initialRecordReceivedTime = 0;
|
private long initialRecordReceivedTime = 0;
|
||||||
|
|
||||||
public void process(ConsumerRecords<String, TestRecord> records) throws Exception {
|
public void process(ConsumerRecords<String, TestRecord> records) throws Exception {
|
||||||
initializeTime();
|
preProcess();
|
||||||
|
|
||||||
log.debug("[RecordProcessor] process {} records. thread: {}", records.count(),
|
log.debug("[RecordProcessor] process {} records. thread: {}", records.count(),
|
||||||
Thread.currentThread().getName());
|
Thread.currentThread().getName());
|
||||||
@ -50,9 +50,11 @@ public class RecordProcessor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initializeTime() {
|
private void preProcess() {
|
||||||
if (initialRecordReceivedTime == 0) {
|
if (initialRecordReceivedTime == 0) {
|
||||||
initialRecordReceivedTime = System.currentTimeMillis();
|
initialRecordReceivedTime = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
emptyPollResultCount.set(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user