| IAsyncRecoveryReadHighestSequenceNrAsync Method |
Asynchronously reads the highest stored sequence number for provided
persistenceId.
The persistent actor will use the highest sequence number after recovery as the starting point when
persisting new events.
This sequence number is also used as `toSequenceNr` in subsequent calls to
ReplayMessagesAsync(IActorContext, String, Int64, Int64, Int64, ActionIPersistentRepresentation) unless the user has specified a lower `toSequenceNr`.
Journal must maintain the highest sequence number and never decrease it.
This call is protected with a circuit-breaker.
Please also not that requests for the highest sequence number may be made concurrently
to writes executing for the same
persistenceId, in particular it is
possible that a restarting actor tries to recover before its outstanding writes have completed.
Namespace:
Akka.Persistence.Journal
Assembly:
Akka.Persistence (in Akka.Persistence.dll) Version: 1.2.3.129 (1.2.3.129)
Syntax Task<long> ReadHighestSequenceNrAsync(
string persistenceId,
long fromSequenceNr
)
abstract ReadHighestSequenceNrAsync :
persistenceId : string *
fromSequenceNr : int64 -> Task<int64>
Parameters
- persistenceId
- Type: SystemString
Persistent actor identifier - fromSequenceNr
- Type: SystemInt64
Hint where to start searching for the highest sequence number.
When a persistent actor is recovering this fromSequenceNr will the sequence
number of the used snapshot, or `0L` if no snapshot is used.
Return Value
Type:
TaskInt64TBD
See Also