Concurrent command execution does not result in Aggregate conflict error


When two commands for the same aggregate and same expected aggregate version are executed at same time in 2 diff pods, both of them go through resulting in inconsistent state of aggregate, instead of throwing Conflict exceptions.

I checked the code we are validating version only when we are loading aggregate, which might have changed between load and save

Can you please guide if I am doing some thing wrong or it is desired behaviour of axon


Hi Vineet,

The concurrency exception should come from the storage of the event.
This holds due to the uniqueness constraint of the aggregate-identifier / sequence-number pair, which if clashed throws firstly a database/AxonServer exception, followed by a ConcurrencyException.
Thus if the same Aggregate is loaded on two distinct instances for command handling, both will ultimately want to store an event.
It is here where you are covered, as the events define the state of your aggregate.

So, unsure what your exact set up is that this isn’t happening for you.
Axon versions, any extensions or other configuration specifics would be good to share here.

Ow and by the way, for future questions I’d like to ask you to go to our new, as the mailing list will be discontinued on the 28th of September.