Files
Ankur 5439c041d0 Add axon-event-sourcing module: Axon 5.4.2 entity, projection, replay
Event-sourced bank account on Axon Framework 5.4.2 + Spring Boot 4.1.1,
with transcripts generated by tests and three reproduced JPA-store variants.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b69H5rTewUKPyhGS8r
2026-12-02 00:02:00 +05:30

1.8 KiB

axon-event-sourcing

Companion project for the article Event Sourcing with Axon Framework 5 and Spring Boot: Entities, Projections and Replays on ankurm.com.

There is deliberately no docs/ folder: the deeper material lives in collapsible "going deeper" sections inside the article itself.

Versions

Axon Framework 5.4.2 (org.axonframework.extensions.spring:axon-spring-boot-starter)
Spring Boot 4.1.1
JDK 25 (Temurin 25.0.5.1)
H2 2.4.240
Hibernate ORM 7.4.5.Final

Quickstart

./scripts/run-all.sh   # tests (writes output/01-04) + broken variants (output/05-07)
./scripts/run.sh       # start the app on :8080

Endpoints

POST /accounts/{id}?owner= open an account
POST /accounts/{id}/deposit?amount= deposit
POST /accounts/{id}/withdraw?amount= withdraw
GET /accounts/{id} read model
GET /accounts/{id}/events raw stored events (diagnostic; delete before shipping)
POST /admin/replay rebuild the read model

Output index

File Shows
output/01-command-flow.txt commands, stored events, read model
output/02-rejections.txt refused commands leave no events
output/03-no-entity-table.txt the entity has no table
output/04-replay.txt read model lost and rebuilt
output/05-variant-tag-key-mismatch.txt JPA store ignores the tag key
output/06-variant-id-only-creator.txt id-only @EntityCreator yields no entity
output/07-variant-two-tags.txt JPA store rejects a second tag

src/broken/ holds the deliberately broken sources for 05-07; they are outside the build.