Let’s say a process need to the interaction of two commands, if the 1st command get executed successfully, but the 2nd command failed and in some extreme condition , for example JVM crash or the network error, in these cases there is no chance to undo the 1st command . How can Axon work well after the system restart ? Should I keep the command idempotent so that the 1st command can be executed again ? If doing so, I should not throw any validation exception in the command handler (the validation could be like checking add something twice ) , so where should I put the validation ?
This maybe a general problem of CQRS, but should we handle properly ?