I’m new to Akka, so if I’ve complete misunderstood everything, please be gentle.
I’m trying to implement a PersistentActor and use EventAdapters to separate between a hand-made domain model and a generated storage model (e.g. Protobuf). I understand how to implement this for events written to the journal.
The part I haven’t quite understood yet is how to do that for snapshots of the actor’s state. I want the actor to work with its state in terms of the domain model, but I would like it to be saved as a snapshot using the generated storage model.
From what I understand, EventAdapters only seem to apply for the journal, not snapshots. Is there a similar mechanism for snapshots? Or am I thinking completely wrong regarding the snapshots?
There are no event adapter for snapshots. The original purpose of event adapters was for migration of events when the classes evolve. For snapshots the thought was that they can be thrown away and replay events instead or store new snapshot format.
Ah, ok. Is there any support for detecting “broken” snapshots? If I change the state domain classes, some serialization protocols will fail to deserialize the stored snapshot (e.g. Java serialization). Can I detect this and then choose to delete the broken snapshot?