public interface DomainEventSequenceAware
DomainEventMessage
their sequences and is capable of
providing the last known sequence number for a given Aggregate identifier.Modifier and Type | Method and Description |
---|---|
Optional<Long> |
lastSequenceNumberFor(String aggregateIdentifier)
Returns the last known sequence number of an Event for the given
aggregateIdentifier . |
Optional<Long> lastSequenceNumberFor(String aggregateIdentifier)
aggregateIdentifier
.
It is preferred to retrieve the last known sequence number from the Domain Event Stream when sourcing an Aggregate from events. However, this method provides an alternative in cases no events have been read. For example when using state storage.
aggregateIdentifier
- the identifier of the aggregate to find the highest sequence forCopyright © 2010–2024. All rights reserved.