Skip to content

Cleanup/remove deprecated modules#4524

Draft
abuijze wants to merge 20 commits into
mainfrom
cleanup/remove-deprecated-modules
Draft

Cleanup/remove deprecated modules#4524
abuijze wants to merge 20 commits into
mainfrom
cleanup/remove-deprecated-modules

Conversation

@abuijze
Copy link
Copy Markdown
Contributor

@abuijze abuijze commented May 4, 2026

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 shims
  • stash/legacy-aggregate — legacy aggregate model (AggregateConfigurer, AggregateConfiguration, Scope, ScopeDescriptor, DomainEventMessage, and related classes)
  • stash/legacy-saga — legacy saga support
  • stash/migration — OpenRewrite migration recipes
  • stash/todo — AF4 code that was awaiting porting to AF5

These 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.

handleSync removal

All handleSync method 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.xml no longer references the removed modules.


This PR is built on top of #4515 and #4520 and will remain in draft until both are merged.

abuijze added 20 commits May 1, 2026 14:25
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).
# 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
Also removed the handleSync methods, which we mainly left intact to support the compilation of these legacy modules.
@smcvb smcvb added Type: Enhancement Use to signal an issue enhances an already existing feature of the project. Priority 1: Must Highest priority. A release cannot be made if this issue isn’t resolved. labels May 4, 2026
@smcvb smcvb added this to the Release 5.2.0 milestone May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority 1: Must Highest priority. A release cannot be made if this issue isn’t resolved. Type: Enhancement Use to signal an issue enhances an already existing feature of the project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants