Fix SQS MessageInterceptor exceptions handling#1600
Merged
tomazfernandes merged 1 commit intoawspring:mainfrom Apr 5, 2026
Merged
Fix SQS MessageInterceptor exceptions handling#1600tomazfernandes merged 1 commit intoawspring:mainfrom
tomazfernandes merged 1 commit intoawspring:mainfrom
Conversation
Contributor
Author
|
CI tests failing due to #1586 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Why
Closes #1595
When a
MessageInterceptorthrows an exception, theMessageListenerExecutionStageis never reached, so the exception never gets wrapped inListenerExecutionFailedException. All downstream pipeline stages (ErrorHandler, after-processing interceptors,AcknowledgementHandler) expect to unwrap a message from the exception chain and fail withIllegalArgumentException: No ListenerExecutionFailedException found to unwrap messages.This breaks valid use cases like interceptor-based idempotency checks that rely on the
ErrorHandlerto gracefully handle rejection.What
MessageProcessingExceptioninterface as a common marker for exceptions that carry message references through the processing pipelineInterceptorExecutionFailedExceptionfor failures in before-processing interceptorsListenerExecutionFailedExceptionnow implementsMessageProcessingException; static utility methods deprecated in favour ofMessageProcessingExceptionequivalentsHow
InterceptorExecutionFailedExceptionviaexceptionallyComposeinAbstractBeforeProcessingInterceptorExecutionStage(both single and batch paths)ErrorHandlerExecutionStage,AbstractAfterProcessingInterceptorExecutionStage,AcknowledgementHandlerExecutionStage) to useMessageProcessingExceptionfor unwrappingAsyncComponentAdaptersto preserve exception type when re-wrapping with updated message headersAcceptance Criteria
InterceptorExecutionFailedExceptionwith message referenceErrorHandler.handle()invoked for interceptor failures (single and batch)AcknowledgementHandlerworks correctly for interceptor failuresTesting
BeforeProcessingInterceptorExecutionStageTestsandBeforeProcessingContextInterceptorExecutionStageTeststo assertInterceptorExecutionFailedExceptionwith correct message referencesErrorHandlerandafterProcessinginterceptor invocation when an interceptor throws (single and batch paths)