snapshots with AxonServer

Hello,

I have configured snapshotting in my application by adding a snapshot trigger definition. How are snapshots stored in Axon Server? How can I test whether an aggregate, with a reasonable amount of events, is really being snapshotted?

Stijn

From the documentation:https://docs.axoniq.io/reference-guide/operations-guide/setting-up-axon-server/tuning

Data directory
Events and Snapshot Events
AxonServer stores all Events and Snapshot Events in segmented files on disk. By default, these files are stored in the ./data directory.
The following settings define an alternative storage location:

axoniq.axonserver.event.storage - path where (regular) events are stored
axoniq.axonserver.snapshot.storage - path where Snapshot Events are stored

Hi Stijn,
The snapshots are stored in the same format as the events in AxonServer (they use different file extensions, and can be stored in a separate location).

If you want to check if the snapshots are actually created you can use the AxonServer REST api, using the request:

http://localhost:8024/v1/events?aggregateId=<AggregateId>&allowSnapshots=true

This will give you the latest snapshot for the aggregate with id and all events after that snapshot.

Marc

Thanks Marc,

I looked this up in the swagger-ui.html specs, (and I realised I should have looked at it more closely). That is indeed a easy way to request the snapshot.
For my test (implemented with JUnit), where I wanted to validate my snapshotting setup by running some updates on a test aggregate and than find out that the state was captured correctly in the aggregate, based on your tip, I ended up using http://localshot:8024/v1/snapshots?aggregateId=
This url gives me the snapshot event(s) only (which was the subject of my test).

Stijn