Hi Christophe, I think that could work, but you are right that it is not the primary use case for akka-persistence. Be aware of that the WS must be able to handle duplicate messages.
A variation of this would be to use a PersistentActor in combination with a PersistentView, and only restart the PersistentView. That is perhaps better separation of concerns. Note that a PersistentView can have its own snapshots, and the replay starts from latest snapshot. Cheers, Patrik On Tue, Feb 10, 2015 at 9:30 AM, Christophe Pache <[email protected]> wrote: > Hello everyone, > > I've just started to work with akka-persistence and would like to use it > in the following case. As I try to hack it a little bit, I would really > like to have your opinion on that. > > I would receive messages into an Actor and process them only if some > WebServices are available. Instead of just writting to some DB, I would use > a PersistentActor and store each event. When the WS is available, I restart > the actor and in the recoverReceive, I send events to the rest of the Flow. > In case the PersistentActor is restarted because of some failure, the rest > of the Flow would just avoid dealing with those messages (FSM). Then, using > a Snapshot, I would define which event have been processed correctly. In > this implementation, the "state" of the PersistentActor would be the number > of message it did store since the latest snapshot. (This would not be used > into a Cluster, thus, I would expect only a really little number of > unexpected recover) > > My idea was that using the Persistence as a buffer with some guarantee was > quite nice design but this may also be a misuse of akka-persistence. I > really like the way we may plug persistence journal into akka-persistence. > > Well, thanks for any suggestion. > > Have a nice Akking Day! > > Christophe > > -- > >>>>>>>>>> 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. > -- Patrik Nordwall Typesafe <http://typesafe.com/> - Reactive apps on the JVM Twitter: @patriknw [image: Scala Days] <http://event.scaladays.org/scaladays-sanfran-2015> -- >>>>>>>>>> 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.
