Skip to content

Rework snapshotting to allow single request snapshot + events streams#4460

Open
hjohn wants to merge 1 commit intoaxon-5.1.xfrom
feature/snapshotting-rework
Open

Rework snapshotting to allow single request snapshot + events streams#4460
hjohn wants to merge 1 commit intoaxon-5.1.xfrom
feature/snapshotting-rework

Conversation

@hjohn
Copy link
Copy Markdown
Contributor

@hjohn hjohn commented Apr 24, 2026

  • Replaces the two-phase snapshot-then-events approach with a unified stream model. A new SourcingStrategy.Snapshot variant on SourcingCondition expresses snapshot intent declaratively; SnapshotCapableEventStorageEngine (a decorator) resolves it by loading the snapshot and prepending a synthetic SnapshotEventMessage to the event stream - giving callers a single, contiguous stream to reduce
  • Introduces EntityLifecycleHandler as the primary abstraction replacing SourcingHandler, consolidating initialize, source, and subscribe into one contract. SnapshottingEntityLifecycleHandler replaces both SnapshottingSourcingHandler and StoreBackedSnapshotter, centralising snapshot load/store logic alongside entity evolution
  • EventSourcingRepository is simplified to a single EntityLifecycleHandler constructor parameter; the old multi-field wiring (eventStore, entityFactory, entityEvolver, sourcingHandler fields) is gone
  • Removes Snapshotter interface and StoreBackedSnapshotter as separate collaborators; removes SnapshottingSourcingHandler; renames SimpleSourcingHandler is replaced by SimpleEntityLifecycleHandler

@hjohn hjohn requested a review from a team as a code owner April 24, 2026 12:04
@hjohn hjohn requested review from MateuszNaKodach, hatzlj and jangalinski and removed request for a team April 24, 2026 12:04
@smcvb smcvb added Type: Enhancement Use to signal an issue enhances an already existing feature of the project. Priority 1: Must Highest priority. A release cannot be made if this issue isn’t resolved. labels Apr 24, 2026
@smcvb smcvb added this to the Release 5.1.1 milestone Apr 24, 2026
@hjohn hjohn force-pushed the feature/snapshotting-rework branch from 158667e to 85c1630 Compare April 24, 2026 14:58
@hjohn hjohn changed the base branch from main to axon-5.1.x April 25, 2026 04:49
@hjohn hjohn force-pushed the feature/snapshotting-rework branch from 85c1630 to 00941d2 Compare April 25, 2026 05:08
@sonarqubecloud
Copy link
Copy Markdown

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: Enhancement Use to signal an issue enhances an already existing feature of the project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants