Java API.
Java API.
Java API.
Tracks concurrent Versioned values which arise from concurrent updates.
Tracks concurrent Versioned values which arise from concurrent updates.
Versioned value type
Update type
A ConcurrentVersions implementation that shall be used if updates replace current versioned values (= full updates).
A ConcurrentVersions implementation that shall be used if updates replace current
versioned values (= full updates). ConcurrentVersionsList
is an immutable data structure.
A ConcurrentVersions implementation that shall be used if updates are incremental.
A ConcurrentVersions implementation that shall be used if updates are incremental.
ConcurrentVersionsTree
is a mutable data structure. Therefore, it is recommended not
to share instances of ConcurrentVersionsTree
directly but rather the Versioned
sequence returned by ConcurrentVersionsTree#all. Later releases will be based on
an immutable data structure.
Please note: This implementation does not purge old versions at the moment (which shouldn't be a problem if the number of incremental updates to a versioned aggregate is rather small). In later releases, manual and automated purging of old versions will be supported.
A conditional command is a command to an EventsourcedActor or EventsourcedView
whose delivery to the actor's command handler is delayed until the following condition
is met: the merge result of all timestamps of events, that have been previously handled
by that actor, must be >=
the given condition
timestamp.
A conditional command is a command to an EventsourcedActor or EventsourcedView
whose delivery to the actor's command handler is delayed until the following condition
is met: the merge result of all timestamps of events, that have been previously handled
by that actor, must be >=
the given condition
timestamp.
For example, this condition is met by an EventsourcedActor or EventsourcedView
if the condition
timestamp is the vector timestamp of an event and that event has been
handled by the actor.
Supports the reliable delivery of messages to destinations by enabling applications to redeliver messages until they are confirmed by their destinations.
Supports the reliable delivery of messages to destinations by enabling applications
to redeliver messages until they are confirmed by their destinations. Both, message
delivery and confirmation must be executed within an EventsourcedActor's event handler.
New messages are delivered by calling deliver
. When the destination replies with a confirmation
message, the EventsourcedActor must generate an event for which the handler calls confirm
.
Until confirmation, delivered messages are tracked as unconfirmed messages. Unconfirmed
messages can be redelivered by calling redeliverUnconfirmed
. This is usually done within a
command handler by processing scheduler messages. Redelivery occurs automatically when the
EventsourcedActor successfully recovered after initial start or a re-start.
Provider API.
Provider API.
Event storage format.
Custom, application-defined event.
Wall-clock timestamp, generated by emitter (EventsourcedActor).
Vector timestamp, generated by emitter (EventsourcedActor).
Id of emitter (EventsourcedActor).
Aggregate id of emitter (EventsourcedActor). This is also the default routing destination
of this event. If defined, the event is routed to event-sourced actors or views with a matching
aggregateId
. In any case, the event is routed to event-sourced actors and views with an
undefined aggregateId
.
Aggregate ids of additional, custom routing destinations. If non-empty, the event is
additionally routed to event-sourced actors and views with a matching aggregateId
.
Highest source log read position from last replication.
Source log id from last replication. Equal to targetLogId
if not replicated yet.
Target log id from last replication.
Source log sequence number from last replication.
Target log sequence number.
An EventsourcedActor
is an EventsourcedView that can also produce (= emit) new events to its
event log.
An EventsourcedActor
is an EventsourcedView that can also produce (= emit) new events to its
event log. New events can be produced with methods persist
, persistN
and persistWithLocalTime
.
They must only be used within the onCommand
command handler. The command handler may only read
internal state but must not modify it. Internal state may only be modified within onEvent
.
An EventsourcedActor
maintains a VectorClock used to time-stamp the events it emits
to the event log. Events that are handled by its event handler update the vector clock.
Events that are pushed from the eventLog
actor but not handled by onEvent
do not
update the vector clock.
An actor that derives internal state from events stored in an event log.
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 the onEvent
event handler. An event handler
defines how internal state is updated from events.
An EventsourcedView
can also store snapshots of internal state with its save
method. During
(re-)start the latest snapshot saved by this actor (if any) is passed as argument to the onSnapshot
handler, if the handler is defined at that snapshot. If the onSnapshot
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 by onEvent
after onSnapshot
returns.
By default, an EventsourcedView
does not define an aggregateId
. In this case, the eventLog
pushes all events to this actor. If it defines an aggregateId
, the eventLog
actor only pushes
those events that contain that aggregateId
value in their routingDestinations
set.
An EventsourcedView
can only consume events from its eventLog
but cannot produce new events.
Commands sent to an EventsourcedView
during recovery are delayed until recovery completes.
A replication connection descriptor.
A replication connection descriptor.
Host of the remote actor system that runs a ReplicationEndpoint.
Port of the remote actor system that runs a ReplicationEndpoint.
Name of the remote actor system that runs a ReplicationEndpoint.
Replication filters applied remotely. Filters are applied to individual event logs where filter keys are the corresponding event log names.
A replication endpoint connects to other replication endpoints for replicating events.
A replication endpoint connects to other replication endpoints for replicating events. Events are replicated from the connected endpoints to this endpoint. The connected endpoints are replication sources, this endpoint is a replication target. To setup bi-directional replication, the other replication endpoints must additionally setup replication connections to this endpoint.
A replication endpoint manages one or more event logs. Event logs are indexed by name. Events are replicated only between event logs with matching names.
Serializable and composable replication filter.
Represents a snapshot of internal state of an EventsourcedActor or EventsourcedView.
Represents a snapshot of internal state of an EventsourcedActor or EventsourcedView.
Snapshot metadata.
Unconfirmed delivery attempts of an EventsourcedActor that implements ConfirmedDelivery.
The actual user-defined snapshot passed as argument to EventsourcedActor#save or EventsourcedView#save.
Snapshot metadata.
Snapshot metadata.
Id of the EventsourcedActor or EventsourcedView that saves the snapshot.
The latest event sequence number covered by the snapshot.
The latest event system timestamp covered by the snapshot.
The latest event vector timestamp covered by the snapshot.
An immutable vector clock.
An immutable vector clock.
Id of the owner process.
The clock's current time.
Vector time, represented as process id -> logical time map.
A versioned value.
A versioned value.
The value.
Timestamp of the event that caused this version.
Creator of the event that caused this version.
Manages concurrent versions of an event-sourced aggregate.
Manages concurrent versions of an event-sourced aggregate.
Aggregate type.
Command type.
Event type.
Aggregate id
Command handler
Event handler
Aggregate.
Java API.
EventsourcedActor