How it works...
In this recipe, we covered the different recovery options Akka persistence provides when handling failure. To demonstrate this, we have created a small actor FriendActor that keeps a list of friends. When creating the actor, we need to provide a Recovery object. It is this object where we can customize how we want the recovery to happen. In the first app, we are adding four friends, taking a snapshot, and removing one of the friends. All these events get persisted for the Hector ID. After running this app, we create four different apps. When we run FriendRecoveryDefault, we see how recovery occurs by default. Based on the output, we can see that it first takes the snapshot and then it replays the event of removing Oliver ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access