@JaversStream annotation declares a handler class that watches Javers audit snapshots for changes to a specific entity type. It is the entry point for the FlowWarden Javers integration module.
Basic Usage
@JaversStream requires the flowwarden-javers module on your classpath. The auto-configuration activates only when Javers is detected.Attributes Reference
Compatible Annotations
The following FlowWarden annotations can be combined with@JaversStream:
@Filter and @Pipeline are not supported: the stream watches the whole snapshot collection and filters by entity type internally.
Handler Annotations
How It Works Internally
JaversStreamContributor, a stream-coreStreamDefinitionContributor, finds the beans annotated with@JaversStreamonce all singletons are created- Declares each one as a
StreamSpecwatching the Javers snapshot collection — a singleonInserthandler (every Javers snapshot is an insert),fullDocument = UPDATE_LOOKUP, the policy annotations mapped to their specs, and the Javers handler names (JAVERS_OnInitial, …) reported to monitoring throughhandlerNames - stream-core validates and registers it like any contributed stream — the module uses no stream-core internals
- On each snapshot insert, an internal dispatcher:
- Filters by
globalId.entitymatching the configuredentityType - Deserializes the
statefield into the domain object via Spring’sMongoConverter - Reconstructs the
CdoSnapshotvia Javers’ JSON converter - Dispatches to the matching
@OnInitial,@OnUpdate, or@OnTerminalhandler
- Filters by