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.
@Bean
public SnapshotTriggerDefinition snapshotTriggerDefinition(Snapshotter snapshotter) {
return new EventCountSnapshotTriggerDefinition(snapshotter, 5);
}
For debugging purposes, I had changed the threshold to 3.