AggregateCreationPolicy.CREATE_IF_MISSING

Hello,
I have a question about AggregateCreationPolicy.CREATE_IF_MISSING.

This afternoon I tried always

Hi Martijn,

As you’ve noted there were some issues in the create-or-update solution introduced in Axon 4.3, of which as far as we know all have been resolved in 4.3.1, as you’ve already mentioned.

I expect that when I use a new ID (for non existing entity) that a new aggregate is created. When entity already exists I dont expect something to be happen. Is my assumption correct?

Well, if the Aggregate you are targeting with the command already exists, then you’d still traverse the command handling function and publish a new event (or several).
So you should expect something to happen if you are using CREATE_IF_MISSING.

The one thing that stands out from your issue is the use of caching.
There might be something within the call chain when you have a CachingEventSourcingRepository configured which does make it fail.
So, as I am not capable of figuring out from just this post what’s going on, it would be valuable if you are able to share a sample project showcasing this failure consistently.
Something similar as was done in this issue shared by Joel would be very valuable to help you out further.

If the bug seems to persist in your application it would be beneficial to create a bug on the issue tracker for a more speedy resolution of it all.

Cheers,

Steven van Beelen

Axon Framework Lead Developer

AxonIQ

twitter-icon_128x128.png