Skip to content

Commit 5f4dfcc

Browse files
hosuabygaryrussell
authored andcommitted
FIX: KafkaMessageListenerContainer#processTimestampSeeks offsetsForTimes method can return map with null values
1 parent 23fbd62 commit 5f4dfcc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2090,7 +2090,13 @@ private void processTimestampSeeks() {
20902090
if (timestampSeeks != null) {
20912091
Map<TopicPartition, OffsetAndTimestamp> offsetsForTimes = this.consumer
20922092
.offsetsForTimes(timestampSeeks);
2093-
offsetsForTimes.forEach((tp, ot) -> this.consumer.seek(tp, ot.offset()));
2093+
2094+
for (TopicPartition tp : offsetsForTimes.keySet()) {
2095+
OffsetAndTimestamp ot = offsetsForTimes.get(tp);
2096+
if (ot != null) {
2097+
this.consumer.seek(tp, ot.offset());
2098+
}
2099+
}
20942100
}
20952101
}
20962102

0 commit comments

Comments
 (0)