Class AppendEvents
java.lang.Object
io.fluxcapacitor.common.api.Request
io.fluxcapacitor.common.api.Command
io.fluxcapacitor.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 class
Compact metric representation of anAppendEvents
command. -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class io.fluxcapacitor.common.api.Command
getGuarantee
-
Constructor Details
-
AppendEvents
public AppendEvents()
-
-
Method Details
-
toString
Returns a human-readable description of the operation. -
routingKey
Returns the routing key used to partition the command, based on the first batch’s aggregate ID.- Overrides:
routingKey
in classCommand
- Returns:
- a routing key string, or
null
if 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
-