Cleanup/remove deprecated modules#4524
Draft
abuijze wants to merge 20 commits into
Draft
Conversation
Adds intercepted() to CompletePhase, enabling MessageHandlerInterceptors to be applied to all event handling components in a configurer. Calling intercepted() closes the component registration phase; subsequent calls accumulate interceptors in registration order.
Adds a third interceptor registration scope to the event handler interceptors section: per-configurer, via intercepted() on EventHandlingComponentsConfigurer. Also fixes a typo in the existing per-processor example (withInterceptr).
…eptors section Resolves #3485
# Conflicts: # messaging/src/main/java/org/axonframework/messaging/core/IgnoredEntriesMessageStream.java # messaging/src/main/java/org/axonframework/messaging/core/MessageStream.java
Therefore, the test for interceptors must not assume that the resulting stream should be consumed before a handler is invoked.
Introduces MessageHandlingExceptionHandler and EventHandlingExceptionHandler interfaces along with ErrorHandlingEventHandlingComponent to let callers intercept exceptions thrown by event handlers - either suppressing them or propagating a different error. Exposes withExceptionHandler() on EventHandlingComponentsConfigurer to apply a handler across all registered components. Also fixes @ExceptionHandler resolution to carry the exception through ProcessingContext instead of a ThreadLocal, making it safe for async/reactive dispatch paths, and adds a null-safety guard for missing interceptor chains in MessageHandlerInterceptorDefinition. Key changes: - New MessageHandlingExceptionHandler / EventHandlingExceptionHandler interfaces - New ErrorHandlingEventHandlingComponent decorator - withExceptionHandler() on EventHandlingComponentsConfigurer - ResultParameterResolverFactory switched from ThreadLocal to ProcessingContext-based result injection - Null-guard in MessageHandlerInterceptorDefinition - Tests enabled and extended, docs updated
…ts (#3062) Introduces CommandHandlingExceptionHandler and QueryHandlingExceptionHandler interfaces, along with ErrorHandlingCommandHandlingComponent and ErrorHandlingQueryHandlingComponent decorators that wrap handling components to intercept handler exceptions. Exception handlers are registered via withExceptionHandler() on the CommandHandlerPhase and QueryHandlerPhase configuration interfaces, and multiple handlers chain in registration order.
…n support Extends the annotated handler interceptor mechanism (already present for events) to command and query handling components. Adds declarative interceptor support to CommandHandlingModule and QueryHandlingModule, mirroring the existing EventHandlingComponentsConfigurer.intercepted() API.
…ler branch Resolves conflicts in CommandHandlingModule, QueryHandlingModule, and their Simple* implementations by combining both interceptor and exception handler support. Interceptors are applied first (inner layer), exception handlers outermost, so exception handlers catch errors from the full chain.
- Enable component-message-intercepting and annotated-exception-handling in nav - Replace annotated-exception-handling.adoc WARNING placeholder with real content - Replace "not yet supported" section in migration guide with migration examples for @CommandHandlerInterceptor, @EventHandlerInterceptor, @QueryHandlerInterceptor, and @ExceptionHandler
- Enable component-message-intercepting and annotated-exception-handling in nav - Replace annotated-exception-handling.adoc WARNING placeholder with real content - Replace "not yet supported" section in migration guide with migration examples for @CommandHandlerInterceptor, @EventHandlerInterceptor, @QueryHandlerInterceptor, and @ExceptionHandler
…re/3062-exception-handler-interceptors
…up/remove-deprecated-handlesync
…up/remove-deprecated-handlesync
Also removed the handleSync methods, which we mainly left intact to support the compilation of these legacy modules.
This was referenced May 4, 2026
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.
Summary
This PR removes the stash modules that were kept around during the AF5 rewrite as a temporary holding area for AF4 code.
Removed modules
The following modules under
stash/have been deleted entirely:stash/legacy— legacy AF4 compatibility shimsstash/legacy-aggregate— legacy aggregate model (AggregateConfigurer,AggregateConfiguration,Scope,ScopeDescriptor,DomainEventMessage, and related classes)stash/legacy-saga— legacy saga supportstash/migration— OpenRewrite migration recipesstash/todo— AF4 code that was awaiting porting to AF5These modules are no longer needed: the relevant parts have either been ported to AF5 or permanently retired. This accounts for the vast majority of the ~93k deleted lines. Reviewers can treat any file deletion under
stash/as intentional removal.handleSyncremovalAll
handleSyncmethod implementations have been removed from the framework. These methods were only kept in place to allow the legacy stash modules to compile, so their removal follows naturally from the module deletions above.The root
pom.xmlno longer references the removed modules.This PR is built on top of #4515 and #4520 and will remain in draft until both are merged.