Still, I don't think you can get snapshots that were saved by the 
"original" persistent actor through the persistence query. It's fairly easy 
to check, though - just save a snapshot and see if you can read it from the 
query.

In any case, what I meant is that instead of only saving the offset in the 
read-side, you could save the offset along with the accumulated state and 
handle that snapshot as part of the persistent actor's recovery (by 
handling SnapshotOffer). Note that saving the offsets (and snapshots) is 
just an optimization, and you don't have to save them after *every* handled 
event. You could save them every number of events, after a certain time 
interval (just make sure they are saved together, so the information 
contained in the snapshot is in sync with the offset).

Tal


On Thursday, January 5, 2017 at 4:21:36 PM UTC+2, rrodseth wrote:
>
> I have a PersistentActor which is a read side projection that runs a 
> persistence-query stream. It's only state is an offset, a Long. Protobuf 
> serialization is used for persistence messages.
>
> I'm preparing to add snapshotting. The examples show a "snap" message 
> handled by calling saveSnapshot.
>
> Am I correct that I should make the internal state passed to 
> saveSnapshot() a Protobuf object as well?
>
> And when would "snap" (or case object SaveSnapShot) typically be sent? 
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to