AggregateServiceReloading
class AggregateServiceReloading<STATE : AggregateState, COMMAND, EVENT>(aggregateStore: AggregateRepository<STATE, COMMAND, EVENT>) : AggregateService<STATE, COMMAND, EVENT> (source)
AggregateService that reconstructs the aggregate for every command and lookup.
Functions
Link copied to clipboard
Link copied to clipboard
open suspend override fun handle(command: CommandEnvelope<COMMAND>): AggregateChangeResult<STATE, EVENT>
Link copied to clipboard
open suspend override fun recoverAppend(preparedAppend: PreparedAppend<EVENT>): AggregateRecoveryResult<STATE, COMMAND, EVENT>
Recovers an append returned by AggregateChangeResult.Failure.OutcomeUnknown without handling the original command again. The exact preparedAppend is resubmitted so the store can recognize an existing commit or safely commit the same prepared events, after which aggregate state is reloaded from committed history.