I am looking at a akka sample, a code snippet:
persist(asList(evt1, evt2), new Procedure<Evt>() {
public void apply(Evt evt) throws Exception {
state.update(evt);
if (evt.equals(evt2)) {
getContext().system().eventStream().publish(evt);
}
}
});
Is it that we need to persist messages first and then move on, and AFTER we
explicitly persist it, if actor gets killed, or the system gets killed,
then only we would be getting messages in recovery?
Is it not that the messages are persisted by default, and after that they
are sent to onReceiveCommand? And in case system crashes during this, then
the next time the same system comes up, onReceiveRecover gets called with
the persisted messages first, and then onReceiveCommand with the current
messages?
On Friday, March 20, 2015 at 7:33:43 PM UTC+5:30, Anders Båtstrand wrote:
>
> Hi
>
> You need to persist messages, see UntypedPersistentActor#persist.
>
> RecoveryCompleted is always received upon startup, yes. Even if the
> journal did not contain any messages.
>
> Best regards,
>
> Anders Båtstrand
>
--
>>>>>>>>>> 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.