Concurrent command execution does not result in Aggregate conflict error

33 views
Skip to first unread message

vineet tiwari

unread,
Sep 19, 2020, 9:06:37β€―AM9/19/20
to Axon Framework Users
Hi,

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


Thanks
Vineet

Steven van Beelen

unread,
Sep 21, 2020, 5:45:39β€―AM9/21/20
to Axon Framework Users
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 https://discuss.axoniq.io/, as the mailing list will be discontinued on the 28th of September.

Cheers,
Steven

--
πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡πŸ‘‡

❗ Please note that this mailing list will be discontinued on September 28 ❗
We are moving to https://discuss.axoniq.io/ and we do hope you'll join us there.
For more details please see https://groups.google.com/g/axonframework/c/V77Wq9g2HLU

πŸ‘†πŸ‘†πŸ‘†πŸ‘†πŸ‘†πŸ‘†πŸ‘†πŸ‘†πŸ‘†πŸ‘†
---
You received this message because you are subscribed to the Google Groups "Axon Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to axonframewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/axonframework/81595392-3cdd-41dc-8c4c-64a6f2f44837o%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages