reference-guide
reference-guide copied to clipboard
Provide disambiguition for Aggregates and Sagas
As a beginner with CQRS and axon-framework i ran into a pitfall. I ponder how the reference guide could help others in my situation to avoid this one.
In fact i attempted to use an Aggregate instead of Saga. More precisely i emitted to Commands aiming the exact same @TargetAggregateIdentifier.
As a result i got AXONIQ-2000 complaining about an event being inserted with sequence-number 0, where 1 was expected. See https://github.com/AxonFramework/AxonFramework/issues/952 for the full stack-trace.
As i read deeper into the guide, the chapter about saga pattern starts in the right way saying that sagas in contrast to aggregates can last long time and can wrap several commands.
What would probably help is to make clear how far you can get with Aggregates and where to start using Sagas.
This can surely be achieved by a better error-message when one is attempting. On the other hand i guess there is some background that is underlying to the assumption that the expected sequence-number should be one.