Hi Martynas, I have queries on your second opinion.
Another solution would be asking for last persisted sequence number when creating PersistentView. Then recovering PersistentView could track incoming messages and determine when recovery is finished and when replay starts. [Prakhyat] How to start PersistentView by last persisted sequence number? As I understand PersistentView will never know its recovery is completed becase it always has to catch up with the PersistentActor. Starting a persistent view from last persisted sequence number instead of going for snapshot makes more sense for me. As we view will start catching/recovering to persistent actor from where it has left. -Prakhyat M M On Thursday, 9 October 2014 20:37:41 UTC+5:30, Martynas Mickevičius wrote: > > Hi Michael, > > yes, that makes sense. However PersistentView does not know when the > original recovery has finished and when the new messages since the creation > of PersistentView are being replayed. Lets think of some solutions to this > use case. > > One solution I can see to this would be to do frequent snapshoting of the > PersistentView state. Then it would be possible to know that the recovery > is SnapshotOffer and other messages are replay from the journal. > > Another solution would be asking for last persisted sequence number when > creating PersistentView. Then recovering PersistentView could track > incoming messages and determine when recovery is finished and when replay > starts. > > On Wed, Oct 8, 2014 at 2:26 PM, delasoul <[email protected] <javascript:>> > wrote: > >> Hello, >> >> depending on how PersistentViews are used, it can be "valuable" >> information. >> If I use the PersistentView as Read model and the PersistentView is >> started and replayed only on request (so not in memory all the time), >> probably >> I need to do smthg after replay has finished and before I answer the >> request. >> >> michael >> >> >> On Wednesday, 8 October 2014 10:10:55 UTC+2, Martynas Mickevičius wrote: >>> >>> Hello Dan, >>> >>> a PersistentActor is told to be in recovery when it is receiving >>> messages from the journal. When message replay from the journal is >>> completed and PersistenActor starts processing messages from the live >>> system - recovery is finished. >>> >>> On the contrary, PersistentView is always getting messages from the >>> journal. It is constantly in recovery state. >>> >>> It is true that PersistentView can get other messages from the system >>> while also getting messages from the journal. To check if the message is >>> from the journal or not, you can call isPersistent in ProcessorView >>> <http://doc.akka.io/api/akka/2.3.6/?_ga=1.98725278.1605653757.1411556235#akka.persistence.PersistentView> >>> while >>> handling a message. >>> >>> Hope this helps. >>> >>> On Wed, Oct 8, 2014 at 1:43 AM, Dan Hopkins <[email protected]> wrote: >>> >>>> Hello all, >>>> >>>> In akka 2.3.6 persistence the docs seem to suggest that a persistent >>>> view has these methods: >>>> >>>> >>>> 1. def recoveryRunning: Boolean >>>> 2. def recoveryFinished: Boolean >>>> >>>> >>>> But these methods are on a PersistentActor, not a PersistentView. >>>> >>>> How does a view check to see if the messages it's getting are >>>> recoveries? I don't see any public methods that would help and it doesn't >>>> seem to get a recovery complete. >>>> >>>> Thanks, >>>> Dan >>>> >>>> -- >>>> >>>>>>>>>> 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 [email protected]. >>>> To post to this group, send email to [email protected]. >>>> Visit this group at http://groups.google.com/group/akka-user. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> >>> >>> -- >>> Martynas Mickevičius >>> Typesafe <http://typesafe.com/> – Reactive >>> <http://www.reactivemanifesto.org/> Apps on the JVM >>> >> >> -- >> >>>>>>>>>> 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 [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at http://groups.google.com/group/akka-user. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Martynas Mickevičius > Typesafe <http://typesafe.com/> – Reactive > <http://www.reactivemanifesto.org/> Apps on the JVM > -- >>>>>>>>>> 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
