Skip to main content
The @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

  1. JaversStreamContributor, a stream-core StreamDefinitionContributor, finds the beans annotated with @JaversStream once all singletons are created
  2. Declares each one as a StreamSpec watching the Javers snapshot collection — a single onInsert handler (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 through handlerNames
  3. stream-core validates and registers it like any contributed stream — the module uses no stream-core internals
  4. On each snapshot insert, an internal dispatcher:
    • Filters by globalId.entity matching the configured entityType
    • Deserializes the state field into the domain object via Spring’s MongoConverter
    • Reconstructs the CdoSnapshot via Javers’ JSON converter
    • Dispatches to the matching @OnInitial, @OnUpdate, or @OnTerminal handler