diff --git a/spring-kafka/src/main/java/org/springframework/kafka/listener/adapter/MessagingMessageListenerAdapter.java b/spring-kafka/src/main/java/org/springframework/kafka/listener/adapter/MessagingMessageListenerAdapter.java index ed68a585c8..4c4f4cb078 100644 --- a/spring-kafka/src/main/java/org/springframework/kafka/listener/adapter/MessagingMessageListenerAdapter.java +++ b/spring-kafka/src/main/java/org/springframework/kafka/listener/adapter/MessagingMessageListenerAdapter.java @@ -718,10 +718,10 @@ protected void asyncFailure(Object request, @Nullable Acknowledgment acknowledgm catch (Throwable ex) { this.logger.error(t, () -> "Future, Mono, or suspend function was completed with an exception for " + source); acknowledge(acknowledgment); - if (canAsyncRetry(request, ex) && this.callbackForAsyncFailure != null) { + if (canAsyncRetry(request, ex) && this.asyncRetryCallback != null) { @SuppressWarnings("unchecked") ConsumerRecord record = (ConsumerRecord) request; - this.callbackForAsyncFailure.accept(record, (RuntimeException) ex); + this.asyncRetryCallback.accept(record, (RuntimeException) ex); } } } @@ -929,7 +929,7 @@ private boolean rawByParameterIsType(Type parameterType, Type type) { /** * Set the retry callback for failures of both {@link CompletableFuture} and {@link Mono}. * {@link MessagingMessageListenerAdapter#asyncFailure(Object, Acknowledgment, Consumer, Throwable, Message)} - * will invoke {@link MessagingMessageListenerAdapter#callbackForAsyncFailure} when + * will invoke {@link MessagingMessageListenerAdapter#asyncRetryCallback} when * {@link CompletableFuture} or {@link Mono} fails to complete. * @param asyncRetryCallback the callback for async retry. * @since 3.3 @@ -937,7 +937,7 @@ private boolean rawByParameterIsType(Type parameterType, Type type) { public void setCallbackForAsyncFailure( @Nullable BiConsumer, RuntimeException> asyncRetryCallback) { - this.callbackForAsyncFailure = asyncRetryCallback; + this.asyncRetryCallback = asyncRetryCallback; } /**