Course Catalog Example
A runnable example application exercises the transformations from these pages end to end.
The university-message-transformation demo models a course catalog that has evolved through several event-schema versions: historic events stay in the store exactly as they were written, and a chain of transformations lifts each one to its current shape on the read path.
See the university-message-transformation example for the full source.
Its README covers running it in-memory or against Axon Server (optionally reporting to AxonIQ Platform), an interactive shell to play around with, and test-suite examples.
What it demonstrates
The demo composes a chain of transformations, each illustrating a technique covered here:
| Transformation | Change | Technique |
|---|---|---|
|
the legacy |
a rename whose output then flows through the |
|
a single |
a single structural transformation on an untyped |
|
|
a typed mapper to the current event that, with the previous transformation, shows chaining in version order |
|
separate |
the |
|
a |
a mapper that reads from the |
|
an unversioned legacy event is lifted onto |
matching unversioned events stored as |
|
every |
|
|
|
a drop, one event in and none out |
A further class, WelcomeMessageBetaCleanupWithoutPreFilter, expresses that last rule without declaringFromTypes(…) to contrast the two predicate-from styles. It is not registered in the chain.
The chain is assembled in CourseCatalogTransformations and registered as an EventTransformerChain component, as shown in Configuring transformations.