[akka-user] mixing FSM and akka-persistence

2014-05-03 Thread Nicola Piccinini
hi all, I am trying to do something like: class MyFSM extends Processor with FSM and at first it seems that it does not work properly. Is it possible to use Processor and FSM together? Thanks, Nicola -- >> Read the docs: http://akka.io/docs/ >> Check the FAQ:

Re: [akka-user] mixing FSM and akka-persistence

2014-05-03 Thread Konrad Malawski
> > Is it possible to use Processor and FSM together? > Yes, http://doc.akka.io/docs/akka/snapshot/scala/persistence.html#state-machines What problems are you seeing? -- Cheers, Konrad 'ktoso' Malawski hAkker - Typesafe, Inc -- >> Read the docs: http:/

Re: [akka-user] mixing FSM and akka-persistence

2014-05-04 Thread christian . kitzmueller
Hi, I can also confirm that this is working - we are using persistence for recovery of our fsm's (storing initialization messages and do snapshots when stopping/hibernating them) Cheers, Christian Am Samstag, 3. Mai 2014 17:20:46 UTC+2 schrieb Konrad Malawski: > > Is it possible to use Process

Re: [akka-user] mixing FSM and akka-persistence

2014-05-04 Thread Nicola Piccinini
> > Yes, > http://doc.akka.io/docs/akka/snapshot/scala/persistence.html#state-machines > thank you for the pointer. The problem was that I had overwritten preStart, with something like: super.preStart() self ! Message and that did not play well with Processor. Since it is probably not a good

Re: [akka-user] mixing FSM and akka-persistence

2014-05-05 Thread Akka Team
Hi Christian, Do you have a small reproducible test case that exposes the problem? If you do, please share so we can look into the possible issue. -Endre On Sun, May 4, 2014 at 2:07 PM, Nicola Piccinini wrote: > Yes, http://doc.akka.io/docs/akka/snapshot/scala/persistence. >> html#state-machin

Re: [akka-user] mixing FSM and akka-persistence

2014-05-06 Thread Nicola Piccinini
hi, I am Nicola (not Christian), I created a github repo for you: https://github.com/pic/akkaTheHutt you have three classes: FiniteStateMachine ( no persistence, extends Actor ) AlmostPersistentFSM ( extends Processor but no use of Persistent ) PersistentFSM ( persistence ) The only differenc

Re: [akka-user] mixing FSM and akka-persistence

2014-05-08 Thread Akka Team
Hi Nicola, thanks for providing the sample project, I tried it out and the problem is that the FSM never processes a single message when instantiated in a TestFSMRef. It works fine if you change it to system.actorOf(Props(new ...)) and then rely on SubscribeTransitionCallBack to monitor the progre

Re: [akka-user] mixing FSM and akka-persistence

2014-05-08 Thread Nicola Piccinini
thanks Roland for taking care of it. What about the second part of my email concerning the problem I have recovering the PersistentFSM: -- There are also three objects that you can run FiniteStateMachineSpes -> Main AlmostPersistentFSMSpec

Re: [akka-user] mixing FSM and akka-persistence

2014-05-08 Thread Akka Team
On Thu, May 8, 2014 at 3:26 PM, Nicola Piccinini wrote: > thanks Roland for taking care of it. > > What about the second part of my email concerning the problem I have > recovering the PersistentFSM: > I think it might well be coupled with the other issue, it seems that the TestFSMRef somehow mix

Re: [akka-user] mixing FSM and akka-persistence

2014-05-08 Thread Nicola Piccinini
>> What about the second part of my email concerning the problem I have >> recovering the PersistentFSM: > > > I think it might well be coupled with the other issue, it seems that the > TestFSMRef somehow mixes up the Processor internals. but that should not be related in any way with the tests.

Re: [akka-user] mixing FSM and akka-persistence

2014-05-08 Thread Martin Krasser
Hi Nicola, PersistentMain doesn't work as you expect because the sequence of messages during "normal" operation and during replay differs: - during normal operation your FSM receives non-persistent StateTimeout events and persistent Done messages. Both are necessary for your FSM to make the

Re: [akka-user] mixing FSM and akka-persistence

2014-05-12 Thread Nicola Piccinini
Martin: your suggestions worked indeed: https://github.com/pic/akkaTheHutt/commit/059a0c0de5a67d0cde5812cfdb823a630dac98d3 Thank you very much, Nicola -- >> Read the docs: http://akka.io/docs/ >> Check the FAQ: >> http://doc.akka.io/docs/akka/current/additional

Re: [akka-user] mixing FSM and akka-persistence

2014-05-12 Thread christian . kitzmueller
Hi, I think I stumbled over a potential pitfall when using a Processor with a FSM - in case I have a RecoveryFailure the FSM will "handle" the message via default handling. If I have read the code correctly, the Processor will stay in a state where it stashes incoming messages forever - which w

Re: [akka-user] mixing FSM and akka-persistence

2014-05-12 Thread Björn Antonsson
Hi Christian, On 12 May 2014 at 11:01:36, christian.kitzmuel...@gmail.com (christian.kitzmuel...@gmail.com) wrote: Hi, I think I stumbled over a potential pitfall when using a Processor with a FSM - in case I have a RecoveryFailure the FSM will "handle" the message via default handling. If I

Re: [akka-user] mixing FSM and akka-persistence

2014-05-12 Thread christian . kitzmueller
Thanks, I just wanted to be sure I wasn't missing something. Cheers, Christian Am Montag, 12. Mai 2014 14:19:33 UTC+2 schrieb Björn Antonsson: > > Hi Christian, > > On 12 May 2014 at 11:01:36, christian@gmail.com ( > christian@gmail.com ) wrote: > > Hi, > > I think I stumbled over a pote