Hi Rohit,
All you would have to provide is a SnapshotTriggerDefinition bean in your application context.
The regular implementation used is the EventCountSnapshotTriggerDefinition, which after N number of events triggers the creation of a snapshot.
A reasonable threshold for this is somewhere between 100 and 250 events by the way.
Next to providing the bean, you will have to set it up for your Aggregate.
Here, you can go two ways:
- Add the name of the SnapshotTriggerDefinition bean to the @Aggregate annotation’s snapshotTriggerDefinition field.
- Provide an AggregateConfigurer bean in your application context which invokes the configureSnapshotTrigger method to set the snapshot trigger definition.
Trusting this will help you out Rohit!
Cheers,
Steven
PS. It is important to note that this mailing list will be discontinued as specified in this thread.
Instead of this mailing list we have moved to use a forum style of communication, at https://discuss-next.axoniq.io/.
Hope to see you there!