load
Loads a state aggregate by its ID up to a specified version.
This method reconstructs the aggregate state by:
Loading from snapshot if tailVersion is Int.MAX_VALUE and a snapshot exists
Creating a new aggregate instance otherwise
Applying events from the event store up to the specified tailVersion
Return
A Mono emitting the reconstructed StateAggregate.
Parameters
The type of the aggregate state.
The unique identifier of the aggregate to load.
Metadata describing the aggregate structure and behavior.
The maximum version to load events up to. Use Int.MAX_VALUE for latest version.
Throws
if aggregateId or metadata is invalid.
if event sourcing fails due to event store errors.
Samples
Loads a state aggregate by its ID up to a specified event time.
This method reconstructs the aggregate state by:
Creating a new aggregate instance
Applying events from the event store that occurred before or at the specified tailEventTime
Return
A Mono emitting the reconstructed StateAggregate.
Parameters
The type of the aggregate state.
The unique identifier of the aggregate to load.
Metadata describing the aggregate structure and behavior.
The maximum event timestamp (in milliseconds since epoch) to load events up to.
Throws
if aggregateId or metadata is invalid.
if event sourcing fails due to event store errors.