Class AppendEvents
java.lang.Object
io.fluxzero.common.api.Request
io.fluxzero.common.api.Command
io.fluxzero.common.api.eventsourcing.AppendEvents
- All Implemented Interfaces:
JsonType
Command used to append one or more event batches to the event store.
Each EventBatch corresponds to a single aggregate instance and contains a list of serialized events along
with metadata such as the aggregate ID and the current sequence number.
This command is typically sent by a client when applying updates to aggregates in an event-sourced system. Events in the same batch are stored atomically and will be assigned sequential positions in the event log.
Routing
The command is routed based on the aggregate ID of the first batch. If multiple batches are included, they should ideally refer to the same aggregate or be routed consistently by design.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCompact metric representation of anAppendEventscommand. -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class Command
getGuarantee
-
Constructor Details
-
AppendEvents
public AppendEvents()
-
-
Method Details
-
toString
-
routingKey
Returns the routing key used to partition the command, based on the first batch’s aggregate ID.- Overrides:
routingKeyin classCommand- Returns:
- a routing key string, or
nullif not specified
-
toMetric
Converts this command to a metric-friendly representation for logging and monitoring.- Returns:
- a safe and compact object suitable for serialization to the metrics log
-