I've read the Akka.Persistence intro at the Petabridge blog, and I find this part of the code a little confusing:
Recover<string>(str => _msgs.Add(str)); // from the journal
Recover<SnapshotOffer>(offer => {
var messages = offer.Snapshot as List<string>;
if(messages != null) // null check
_msgs = _msgs.Concat(messages);
});
What you probably want to do on recovery is... first take the last snapshot, then replay messages from the journal on top of it.
But here we have two Recover()
declarations, and the journal one is first. When Akka .NET executes recovery, how does the order of these Recover()
methods actually play out in practice?