AxonFramework / AxonFramework

Framework for Evolutionary Message-Driven Microservices on the JVM
https://axoniq.io/
Apache License 2.0
3.32k stars 790 forks source link

Revise `MessageHandlerInterceptor` and `MessageDispatcherInterceptor` API #3103

Open smcvb opened 2 months ago

smcvb commented 2 months ago

Enhancement Description

With the introduction of the new Unit of Work (in #2953), we also added the ProcessingContext and MessageStream as integral parts to the async native message handler support.

These changes need to persist throughout Axon Frameworks infrastructure. That thus includes the MessageHandlerInterceptor and MessageDispatcherInterceptor. Through the flow of pull request #3003, we already touched on both files, (1) deprecating the old methods and (2) introducing new, unimplemented methods that carry the ProcessingContext and return a MessageStream.

Next to supporting the new API, these changes will ensure the MessageDispatchInterceptor can (finally) return the result from dispatching back to the user. This two-way-street is adamant to, for example, have a clean solution to return the position of the last applied event.

Current Behaviour

The old methods are deprecated, but the new methods are not yet implementated.

Wanted Behaviour

The old methods are removed and the new solutions using the MessageStream is implemented.