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.
Confirms the message delivery identified by deliveryId
.
Confirms the message delivery identified by deliveryId
.
Delays handling of command
to that point in the future where all previously called persist
or persistN
operations completed.
Delays handling of command
to that point in the future where all previously called persist
or persistN
operations completed. Therefore, using this method only makes sense if stateSync
is set to false
. The handler
is called during a separate message dispatch by this actor,
hence, it is safe to access internal state within handler
.
Delivers the given message
to a destination
.
Delivers the given message
to a destination
. The delivery of message
is identified by
the given deliveryId
which must be unique in context of the sending actor. The message is
tracked as unconfirmed message until delivery is confirmed with confirm
, using the same
deliveryId
.
Event log actor.
Event log actor.
Optional aggregate id.
Optional aggregate id. Not defined by default.
Global unique actor id.
Global unique actor id.
Internal API.
Internal API.
Internal API.
Internal API.
Internal API.
Internal API.
Emitter aggregate id of the last handled event.
Emitter aggregate id of the last handled event.
Emitter id of the last handled event.
Emitter id of the last handled event.
Sequence number of the last handled event.
Sequence number of the last handled event.
Wall-clock timestamp of the last handled event.
Wall-clock timestamp of the last handled event.
Vector 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.
Command handler.
Command handler.
Event handler.
Event handler.
Sets this actor's command handler.
Sets this actor's command handler.
Sets this actor's event handler.
Sets this actor's event handler.
Sets this actor's snapshot handler.
Sets this actor's snapshot handler.
Called after recovery successfully completed.
Called after recovery successfully completed. Can be overridden by implementations.
Snapshot handler.
Snapshot handler.
Persists the given event
and asynchronously calls handler
with the persist result.
Persists the given event
and asynchronously calls handler
with the persist result.
The handler
is called during a separate message dispatch by this actor, hence, it
is safe to modify internal state within handler
.
Asynchronously persists the given event
and calls handler
with the persist result.
Asynchronously persists the given event
and calls handler
with the persist result.
The handler
is called during a separate message dispatch by this actor, hence, it is
safe to modify internal state within handler
. The handler
can also obtain a reference
to the initial command sender via sender()
.
By default, the event is routed to event-sourced destinations with an undefined aggregateId
.
If this actor's aggregateId
is defined it is additionally routed to all actors with the same
aggregateId
. Further routing destinations can be defined with the customDestinationAggregateIds
parameter.
Asynchronously persists a sequence of events
and calls handler
with the persist
results.
Asynchronously persists a sequence of events
and calls handler
with the persist
results. The handler
is called for each event in the sequence during a separate
message dispatch by this actor, hence, it is safe to modify internal state within
handler
. The handler
can also obtain a reference to the initial command sender
via sender()
. The onLast
handler is additionally called for the last event in
the sequence.
By default, the event is routed to event-sourced destinations with an undefined aggregateId
.
If this actor's aggregateId
is defined it is additionally routed to all actors with the same
aggregateId
. Further routing destinations can be defined with the customDestinationAggregateIds
parameter.
Asynchronously persists the event returned by f
and calls handler
with the persist
result.
Asynchronously persists the event returned by f
and calls handler
with the persist
result. The input parameter to f
is the current local time which is the actor's logical
time, taken from its internal vector clock, and not the current system time. The handler
is called during a separate message dispatch by this actor, hence, it is safe to modify
internal state within handler
. The handler
can also obtain a reference to the initial
command sender via sender()
.
By default, the event is routed to event-sourced destinations with an undefined aggregateId
.
If this actor's aggregateId
is defined it is additionally routed to all actors with the same
aggregateId
. Further routing destinations can be defined with the customDestinationAggregateIds
parameter.
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.
Redelivers all unconfirmed messages.
Redelivers all unconfirmed messages.
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
.
Asynchronously saves the given snapshot
.
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()
.
State synchronization.
State synchronization. If set to true
, commands see internal state that is
consistent with the event log. This is achieved by stashing new commands if this actor
is currently writing events.
If set to false
, commands see internal state that might be stale. To see state updates
from any previously persisted events, applications can delay
these commands. In this mode,
commands are not stashed and events can be batched for write which significantly increases
write throughput.
Delivery ids of unconfirmed messages.
Delivery ids of unconfirmed messages.
Java API.
EventsourcedActor