For this recipe, we will list the steps on how event sourcing works with Akka:
- Once we create a persistent actor, recovery triggers. Akka persistence checks whether there are either events in the journal or snapshots in the snapshot store for the given persistence ID.
- If it finds events in the journal, it proceeds to replay those events to update the state accordingly. If your actor receives other messages while doing this, they get stashed to be processed once the recovery has been completed.
- If it finds a snapshot in the snapshot store, it proceeds to update the state accordingly. If your actor receives other messages while doing this, they get stashed to be processed once the recovery has been completed.
- Once your actor ...