Snapshotting warns when it exceeds the threshold

When snapshotting exceeds the threshold, it throws the following warning

org.axonframework.eventsourcing.IncompatibleAggregateException(Aggregate identifier must be non-null after applying an event. Make sure the aggregate identifier is initialized at the latest when handling the creation event.)

Can you suggest a solution?
Thank you

Hi Kuldeep,

There could be several things going wrong, it would be best to look at how the aggregate is serialized, and maybe build a test around it.

Assuming you use Jackson, and it’s indeed related, you can solve it in several ways. Likely the aggregate I’d field is private, without getters. If you add a public getter, Jackson should also serialize the aggregate id. There are several other solutions, like adding Jackson annotations.

1 Like