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 Event Processing logic #3098

Open smcvb opened 2 months ago

smcvb commented 2 months ago

While working on Axon Framework 5, we should take the opportunity to adjust the Event Processing logic.

First and foremost, the new Unit of Work, ProcessingContext, and MessageStream APIs (in #3069) are a must to be implemented by the existing event processing API.

Apart from this, this issue is about topics like:

  1. Event Handling Component -> Processing Group -> Event Processor
  2. Infrastructure layering
  3. Configuration
  4. Defaults

Event Handling Component -> Processing Group -> Event Processor

Do we still need the layering from Event Handling Component in Processing Group in Event Processor? When you have been working with these layers, the benefits become clear. However, it is, and will be, a hard topic to explain to users throughout.

It might happen that this is the right flow, but this is the right time to take a step back to reconsider.

Infrastructure layering

This reflects a simillar task as has been done with the command bus in PR #3003. Thus, we break down the complex Event Processors and Processing Groups (internally called EventHandlingInvokers) into there different concerns. This layering will enhance the modularity and, thus, the testability for us. Furthermore, it could upon up an easy way for users to inject their own behavior at the exact level in the process.

Configuration

Rework the configuration API to align with the new infrastructure layering. Through this, it should become easier to configure event processing to a user's liking.

Defaults

For the components that remain we should revise the defaults currently in place. Think about things like: