Force creation of snapshots


A question on how to force axon to create snapshots for all my aggregates. I have created a SnapshotTriggerDefinition which creates a snapshot after 50 events. This definition is only triggered when a new event comes in. That’s when the eventHandled method gets called and starts to count the number of events. We are expecting a big load in the next weeks which will affect all our aggregates. Is it possible to create a snaphot of each aggregate prior to this load, in some sort of batch? This will speed up loading the aggregates once this big load starts.

Thanks, Norbert

Hi @Norbert_Terhorst,

You can create a specific command that will trigger a snapshot of an Aggregate.
One of our colleagues already answered something similar on Stackoverflow and this is why I am linking it here instead of copying the solution.

Hope it helps!

1 Like

Hi Lucas,

That’s it! Thanks