Optional aggregate id.
Optional aggregate id. It is used for routing DurableEvents to event-sourced destinations
which can be EventsourcedViews or EventsourcedActors. By default, an event is routed
to an event-sourced destination with an undefined aggregateId
. If a destination's aggregateId
is defined it will only receive events with a matching aggregate id in
DurableEvent#destinationAggregateIds.
Internal API.
Internal API.
Internal API.
Internal API.
Internal API.
Internal API.
Emitter aggregate id of the last handled event.
Emitter id of the last handled event.
Sequence number of the last handled event.
Wall-clock timestamp of the last handled event.
Vector timestamp of the last handled event.
Sends a LoadSnapshot command to the event log.
Sends a LoadSnapshot command to the event log. Can be overridden by implementations to customize snapshot loading.
Called after recovery successfully completed.
Called after recovery successfully completed. Can be overridden by implementations.
Snapshot handler.
Initiates recovery by calling load.
Initiates recovery by calling load.
Initialization behavior.
Initialization behavior.
Returns true
if this actor is currently recovering internal state by consuming
replayed events from the event log.
Returns true
if this actor is currently recovering internal state by consuming
replayed events from the event log. Returns false
after recovery completed and
the actor switches to consuming live events.
Sends a Replay command to the event log.
Sends a Replay command to the event log. Can be overridden by implementations to customize replay.
Asynchronously saves the given snapshot
and calls handler
with the generated
snapshot metadata.
Asynchronously saves the given snapshot
and calls handler
with the generated
snapshot metadata. The handler
can also obtain a reference to the initial message
sender via sender()
.
An actor that derives internal state from events stored in an event log. Events are pushed from the
eventLog
actor to this actor and handled with theonEvent
event handler. An event handler defines how internal state is updated from events.An
EventsourcedView
can also store snapshots of internal state with itssave
method. During (re-)start the latest snapshot saved by this actor (if any) is passed as argument to theonSnapshot
handler, if the handler is defined at that snapshot. If theonSnapshot
handler is not defined at that snapshot or is not overridden at all, event replay starts from scratch. Newer events that are not covered by the snapshot are handled byonEvent
afteronSnapshot
returns.By default, an
EventsourcedView
does not define anaggregateId
. In this case, theeventLog
pushes all events to this actor. If it defines anaggregateId
, theeventLog
actor only pushes those events that contain thataggregateId
value in theirroutingDestinations
set.An
EventsourcedView
can only consume events from itseventLog
but cannot produce new events. Commands sent to anEventsourcedView
during recovery are delayed until recovery completes.DurableEvent
EventsourcedActor