I’m using Axon 3.0.6 and have a very simple non-event sourced JPA aggregate of the form shown in the docs (command-model.html). I dispatch a command and supply a CommandCallback so I can record success and failure.
The aggregate is a simple JPA Entity and correctly fails to be persisted if the aggregate with the given Id already exists (the Id is an email address). The command callback’s onFailure() method is called as expected. However, the event is still applied in the aggregate’s constructor - even though the command failed - causing other components to handle the event. I was expecting that the event would not be applied due to the command failure. Is my understanding incorrect? Or do I need to look more closely at my code/config?