AxonFramework / AxonFramework

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

Reconsider `AggregateLifecycle#markDeleted` #3084

Open smcvb opened 1 month ago

smcvb commented 1 month ago

Although AggregateLifecycle#markDeleted served its purpose, we've seen people enter unexpected scenarios when using this functionality, as the aggregate could no longer be reached.

Furthermore, adding a simple boolean deleted to a model is, in most cases, sufficient. Combining this with the @MessageHandlerInterceptor inside the model makes it so you can recreate the entire behavior of AggregateLifecycle#markDeleted without using "framework magic."