Type of this processor's event handler.
Event log actor.
Event log actor.
Global unique actor id.
Global unique actor id.
Command handler.
Command handler.
This processor's event handler.
This processor's event handler. It may generate zero or more processed events per source event.
This processor's target event log.
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.
Returns the command BehaviorContext.
Returns the command BehaviorContext.
Returns an command BehaviorContext that doesn't allow event handler behavior changes.
Returns an command BehaviorContext that doesn't allow event handler behavior changes. An
attempt to change the event handler behavior with eventContext.become()
will throw an
UnsupportedOperationException.
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.
Id of the local event log that initially wrote the event.
Id of the local event log that initially wrote the 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.
This actor's logging adapter.
This actor's logging adapter.
Collects processed events generated by processEvent
.
Collects processed events generated by processEvent
.
Recovery completion handler.
Recovery completion handler. If called with a Failure
, the actor will be stopped in
any case, regardless of the action taken by the returned handler. The default handler
implementation does nothing and can be overridden by implementations.
Snapshot handler.
Snapshot handler.
Override to allow post-processing of DurableEvent instances wrapping events generated by processEvent
.
Override to allow post-processing of DurableEvent instances wrapping events generated by processEvent
.
Amongst other things, this can e.g. be used to set different or additional aggregate IDs for custom routing destinations (which by default take the same routing destinations as the original event that was processed).
Sets recovering
to false
before calling super.postStop
.
Sets recovering
to false
before calling super.postStop
.
Sets recovering
to false
before calling super.preRestart
.
Sets recovering
to false
before calling super.preRestart
.
Initiates recovery.
Initiates recovery.
Asynchronously reads the processing progress from the target event log.
Asynchronously reads the processing progress from the target event log.
Called with failure details after a read
operation failed.
Called with failure details after a read
operation failed. Throws EventsourcedWriter#ReadException
by default (causing the writer to restart) and can be overridden.
Sets the read processing progress for this processor and returns it incremented by 1.
Sets the read processing progress for this processor and returns it incremented by 1.
The default read timeout configured with the eventuate.log.read-timeout
parameter.
The default read timeout configured with the eventuate.log.read-timeout
parameter.
Can be overridden.
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.
Maximum number of events to be replayed to this actor before replaying is suspended.
Maximum number of events to be replayed to this actor before replaying is suspended. A suspended replay
is resumed automatically after all replayed events haven been handled by this actor's event handler
(= backpressure). The default value for the maximum replay batch size is given by configuration item
eventuate.log.replay-batch-size
. Configured values can be overridden by overriding this method.
Disallow for EventsourcedWriter and subclasses as event processing progress is determined by read
and readSuccess
.
Disallow for EventsourcedWriter and subclasses as event processing progress is determined by read
and readSuccess
.
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 obtain a reference to the initial message
sender with sender()
.
Returns the snapshot BehaviorContext.
Returns the snapshot BehaviorContext.
Adds the current command to the user's command stash.
Adds the current command to the user's command stash. Must not be used in the event handler.
Prepends all stashed commands to the actor's mailbox and then clears the command stash.
Prepends all stashed commands to the actor's mailbox and then clears the command stash.
Has no effect if the actor is recovering i.e. if recovering
returns true
.
Asynchronously writes processed events that have been collected since the last write together with the current processing progress.
Asynchronously writes processed events that have been collected since the last write together
with the current processing progress. If the number of processed events since the last write
is greater than the configured eventuate.log.write-batch-size
multiple batches with a size
less than or equal to eventuate.log.write-batch-size
will be written sequentially. When
splitting into multiple batches it is guaranteed that the processing result of a single event
is part of the same batch i.e. it is guaranteed that the processing result of a single event
is written atomically. If the processing result of a single event is larger than
eventuate.log.write-batch-size
, write
write does not split that batch into smaller batches.
Called with failure details after a write
operation failed.
Called with failure details after a write
operation failed. Throws EventsourcedWriter#WriteException
by default (causing the writer to restart) and can be overridden.
Sets the written processing progress for this processor.
Sets the written processing progress for this processor.
The default write timeout configured with the eventuate.log.write-timeout
parameter.
The default write timeout configured with the eventuate.log.write-timeout
parameter.
Can be overridden.
An EventsourcedWriter that writes processed events to a
targetEventLog
.EventsourcedProcessor
is an idempotent writer that guarantees that no duplicates are ever written to the target event log, also under failure conditions. Hence, applications don't need to take extra care about idempotency. Processed events are those returned byprocessEvent
, an application-defined event handler that is invoked with events from the sourceeventLog
.During initialization, a processor reads the processing progress from the target event log. The timeout for this read operation can be configured with the
eventuate.log.read-timeout
parameter for all event-sourced processors or defined on a per class or instance basis by overridingreadTimeout
. The timeout for write operations to the target log can be configured with theeventuate.log.write-timeout
parameter for all event-sourced processors or defined on a per class or instance basis by overridingwriteTimeout
.An
EventsourcedProcessor
is a stateless processor i.e. in-memory state created from source events can not be recovered. An application that needs stateful event processing should use StatefulProcessor instead.An
EventsourcedProcessor
processor writes events with vector timestamps set to source event vector timestamp. In other words, it does not modify event vector timestamps.The source event log and the target event log of an
EventsourcedProcessor
must be different. Writing processed events back to the source event log has no effect.StatefulProcessor