Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add Snapshotting annotation support#4553

Open
hjohn wants to merge 1 commit intomainAxonIQ/AxonFramework:mainfrom
feature/snapshotting-annotationsAxonIQ/AxonFramework:feature/snapshotting-annotationsCopy head branch name to clipboard
Open

Add Snapshotting annotation support#4553
hjohn wants to merge 1 commit intomainAxonIQ/AxonFramework:mainfrom
feature/snapshotting-annotationsAxonIQ/AxonFramework:feature/snapshotting-annotationsCopy head branch name to clipboard

Conversation

@hjohn
Copy link
Copy Markdown
Contributor

@hjohn hjohn commented May 8, 2026

Adds a @Snapshotting class-level annotation for event-sourced entities, allowing snapshotting to be configured declaratively alongside @EventSourcedEntity instead of requiring the programmatic builder API.

The annotation supports an event-count threshold (afterEvents, defaulting to 50) and a sourcing-time threshold (afterSourcingTime as an ISO-8601 duration). Both conditions are combined with logical OR when both are set.

The annotation is processed by AnnotatedEventSourcedEntityModule, which means it is picked up automatically by the Spring integration as well. Reference guide and migration guide updated accordingly.

Resolves #4306

Also an idea to extend this further with a @TakeSnapshot annotation that you can place on an event handler, and a snapshot will then be taken each time such an event occurs (ie. AccountClosed, CloseFinancialQuarter)

@hjohn hjohn requested a review from a team as a code owner May 8, 2026 09:41
@hjohn hjohn requested review from MateuszNaKodach, hatzlj and laura-devriendt-lemon and removed request for a team May 8, 2026 09:41
@hjohn hjohn self-assigned this May 8, 2026
@hjohn hjohn added Priority 1: Must Highest priority. A release cannot be made if this issue isn’t resolved. Type: Enhancement Use to signal an issue enhances an already existing feature of the project. Type: Feature Use to signal an issue is completely new to the project. and removed Type: Enhancement Use to signal an issue enhances an already existing feature of the project. labels May 8, 2026
@hjohn hjohn added this to the Release 5.1.1 milestone May 8, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 8, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority 1: Must Highest priority. A release cannot be made if this issue isn’t resolved. Type: Feature Use to signal an issue is completely new to the project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Simplify SnapshotPolicy/Snapshotter configuration through annotations

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.