Skip to content

Commit fabbb6f

Browse files
committed
GH-1247: Polishing
- revert lastPoll position - fix new race in existing test
1 parent 7cfc482 commit fabbb6f

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

spring-kafka/src/main/java/org/springframework/kafka/listener/KafkaMessageListenerContainer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,6 @@ protected void pollAndInvoke() {
743743
}
744744
processSeeks();
745745
checkPaused();
746-
this.lastPoll = System.currentTimeMillis();
747746
this.polling.set(true);
748747
ConsumerRecords<K, V> records = this.consumer.poll(this.pollTimeout);
749748
if (!this.polling.compareAndSet(true, false)) {
@@ -756,6 +755,7 @@ protected void pollAndInvoke() {
756755
}
757756
return;
758757
}
758+
this.lastPoll = System.currentTimeMillis();
759759
checkResumed();
760760
debugRecords(records);
761761
if (records != null && records.count() > 0) {

spring-kafka/src/test/java/org/springframework/kafka/listener/KafkaMessageListenerContainerTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,6 @@ public void onMessage(ConsumerRecord<Integer, String> data) {
587587
inOrder.verify(messageListener).onMessage(any(ConsumerRecord.class));
588588
inOrder.verify(consumer).commitSync(any(Map.class));
589589
container.stop();
590-
verify(consumer).wakeup();
591590
}
592591

593592
@SuppressWarnings("unchecked")

0 commit comments

Comments
 (0)