Skip to content
Javers docs0.2

Failure contracts

Latest stable Based on Javers release 0.2.1

The 0.2.1 adapters propagate storage and publication failures, but propagation is not rollback. Define what remains after each step before adding retries.

Failure pointPossible stateRequired production response
domain persistenceno audit or eventnormal command retry policy
JaVers snapshot/commit sequencedomain state may already exist; partial audit writes are possiblereconcile by aggregate, GlobalId, version, and commit ID
Kafka publicationdomain and audit may exist without an eventoutbox/retry record; do not blindly repeat the whole command
consumer/projectionKafka record may be replayed; Redis may be stale or partly updatedidempotent apply, controlled offsets, replay and drift repair

AbstractCdoSnapshotRepository.persist saves snapshots one at a time, then advances the in-memory head and writes a commit sequence. A thrown exception stops later work; it does not undo already completed external writes. The implementation is in AbstractCdoSnapshotRepository.kt.

Idempotency is an application contract in 0.2.1. SQL has a unique GlobalId/version index, Kafka uses GlobalId as a key, and the example uses deterministic Redis keys, but none supplies a complete command/event deduplication protocol. Record stable command and event IDs, decide whether duplicate commits are allowed, and make projection updates compare an event sequence or version.

Schema ownership also belongs to deployment. ensureSchema() is convenient, not a migration ledger. Kafka topic retention/partitioning and Redis persistence/eviction are equally part of correctness. Document owners and recovery commands alongside the service.

Continue with observability to turn these states into signals.