Repository navigation
[#244] Add snapshot transformation - #815
Conversation
Build status (run 47348969900, commit 55ad89e)JDK 21 - SUCCESS - 33 modules (33 cached, 0 built) in 00:09Per-module details
JDK 25 - SUCCESS - 33 modules (33 cached, 0 built) in 00:13Per-module details
|
|
Although strictly a feature, marked as a bug since this functionality is currently blocking users migrating their snapshots from AF4 into AF5. |
b56612c to
173d106
Compare
0f77a81 to
0ffd131
Compare
0ffd131 to
b2b219f
Compare
smcvb
left a comment
There was a problem hiding this comment.
Enough comments to warrant request changes. I think my biggest concern with this is the rather large deviation from event transformation. I'd prefer we take a similar approach for both as much as possible, as that lowers the cognitive load for both us and users, as things are simply alike.
There was a problem hiding this comment.
Outside the inline comments: in my Heroes app (Spring Boot, JPA on PostgreSQL) an app without a chain behaves as on main (whole test suite identical), and the pass-through fixes a main bug where an event transformation matching every type broke every snapshot load.
Evidence: probe tests, Heroes end-to-end.
b2b219f to
b7557d1
Compare
bb04db4 to
9d3a38f
Compare
MateuszNaKodach
left a comment
There was a problem hiding this comment.
Thanks for addressing my remarks :)
smcvb
left a comment
There was a problem hiding this comment.
New set of comments. I think the chain-within-chain difference between Snapshot and Event Transformation is my biggest concern.
9d3a38f to
6b8b9e5
Compare
6b8b9e5 to
6d33868
Compare
6d33868 to
51055c8
Compare
smcvb
left a comment
There was a problem hiding this comment.
My concerns have been addressed, hence approving this PR! Some nits here and there, but none of those should block this PR any further.
76a7c3a to
dfefcea
Compare
Lifts snapshots stored under an earlier name or version, or aggregate-based snapshots such as those taken by Axon Framework 4, into an entity's current type while it is sourced. Event transformation now passes snapshots through untouched.
dfefcea to
55ad89e
Compare
|
/backport axoniq-5.4.x |
|
Successfully created backport PR for |
SnapshotTransformation: a mapping of the state from one snapshot identity (VersionedType) to another, declared withfrom(...).to(...).transform(...), or a rename declared withrename(source, target);fromAggregateBased(...).storedBy(converter)starts from an aggregate-based snapshot such as one taken by Axon Framework 4. The chain joins transformations where one leads to the source of another.SnapshotTransformerChainresolves backward from an entity's current type to every identity worth looking up, plus at most one aggregate-based query, and transforms a found snapshot forward. A mapper may drop the snapshot by returningnull, which sources the entity in full; a mapper that throws is logged as a warning and sources the entity in full too.SnapshotTransformingEventStore, installed bySnapshotTransformationConfigurationEnhancerwhen a chain is registered, widens the snapshot lookup and transforms the snapshot found.AxonIQ/AxonFramework#5369 updates the Axon Framework migration example (no
build()); merge it together with this PR. Aggregate-based lookups only find something with a store that serves them; for Axon Server that comes with #683, which in turn waits on unreleased Axon Server API changes.By doing the above, this PR resolved #244.
This PR should be back ported to
axoniq-5.4.xonce approved and merged.