It’s my first time implementing an application using CQRS and/or Axon so bear with me if this question is either misguided or just plain stupid ;-).
The system we’re building communicates with multiple other external systems. These systems use a certain protocol to communicate with our system but we do not want to tightly couple our commands and domain layer to the semantics of this protocol (this is a must-have requirement). Because of this we’re running into certain situations in which a single protocol message translates into multiple commands. For the most part, we don’t need to handle these commands in any specific order but in some cases a single message leads to the creation of an aggregate and the following commands need to be handled after the command which creates the aggregate (naturally).
- A protocol message is received for a non-existent aggregate.
- This should cause to the following commands to be dispatched:
- DoCCommand- The CreateAggregateCommand must be handled before any of the other commands.
- The order in which DoACommand, DoBCommand, and DoCCommand are handled are not important. (To me, this sounds like a saga…)
The added complexity is that I’d like to use the CreateAggregateCommand in other scenarios which (I think) makes using a saga for this issue a no-go. Maybe we shouldn’t reuse this specific command and create a separate command which better describes the intent of the action though.
Any help or guidance on this issue would be appreciated!