I have a question about creating fat events.
So let’s say we have an event A (e.g. ImageCreatedEvent) and later on we have an event B (e.g ImageTransformedEvent).
In our cases Event B typically has a link to the identifier of Event A to reference to the source. In this case the transformed image refers to the original image.
Now in case we want to create sagas we always have to listen on Event A as the association field that defines its scope is missing in Event B. For example, the ImageCreatedEvent has a project field…and the saga should operate per project.
We already start the saga when we see Event A, and create an association on the reference field to catch Event B.
This makes Sagas much slower and more complex. Especially because sagas are single threaded (and we prefer not to turn them in eventhandlers)
Since Event A is immutable in our case (as the necessary fields will never change later on), we could make FAT Event B … including all/some fields of A in Event B.
In our cases we generate Event B in an aggregate where we don’t have access to the fields of A to create the fat Event. It’s not part of the command, as we get this command from the client side.
What’s the best solution to create a fat Event in this case?
Use a query in the aggregate to fetch the necessary additional fields? (Doesn’t feel like a best practice?)
Can we intercept the command to add extra fields based on querying a read model? It’s more like a CommandEnhancer? (Not sure this is possible with AxonFramework?)
Use an eventhandler to generate a new event C that will use a read model to combine both event data? This is possible. Not sure how we would name this new event? ImageTransformedFatEvent?
Any other solution?