Snapshots with Axon (4.0.3) and MongoDB

Hello,

I tried to implement snapshots in an application that uses Axon 4 with Spring Boot 2.1.3. I intend it to save a snapshot every 5 events. But what is happening is that a snapshot is created after the first 5 events, and that’s it. No snapshot is created after that, no matter how many events are created.

However, if I manually delete the snapshot, another one is created on the very next event applied.

These are the configurations I have used:

For snapshotter config:

Correction:


@Bean
public SnapshotTriggerDefinition snapshotTriggerDefinition(Snapshotter snapshotter) {
    return new EventCountSnapshotTriggerDefinition(snapshotter, 5);
} 

For debugging purposes, I had changed the threshold to 3.

Hi Komal,

your configuration doesn’t seem off at first glance. I will try to reproduce it. You shouldn’t have to remove snapshots.

Which EventStore implementation do you use?

Cheers,

Allard

Hi Komal,

I am unable to reproduce the issue.
Could provide more details on your (snapshotting) configuration?

Kind regards,