Skip to content

Commit 64e7806

Browse files
authored
spring-projectsGH-3076: Set batchFailed state in ListenerConsumer even if no commonErrorHandler is configured
Fixes: spring-projects#3076
1 parent cd4341c commit 64e7806

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
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
@@ -2290,13 +2290,13 @@ private RuntimeException doInvokeBatchListener(final ConsumerRecords<K, V> recor
22902290
}
22912291
}
22922292
catch (RuntimeException e) {
2293+
this.batchFailed = true;
22932294
failureTimer(sample, null);
22942295
batchInterceptAfter(records, e);
22952296
if (this.commonErrorHandler == null) {
22962297
throw e;
22972298
}
22982299
try {
2299-
this.batchFailed = true;
23002300
invokeBatchErrorHandler(records, recordList, e);
23012301
commitOffsetsIfNeededAfterHandlingError(records);
23022302
}

0 commit comments

Comments
 (0)