3

I`m using Akka FSM in my project and going to add persistence. The straightforward solution is to use Persistent FSM (https://doc.akka.io/docs/akka/current/persistence-fsm.html)

However in the official documentation exists warning Warning Persistent FSM is no longer actively developed and will be replaced by Akka Typed Persistence. It is not advised to build new applications with Persistent FSM.

But there no examples how to use typed persistence for FSM actors. All that I see is how to use typed persistence for Typed Actors.

Is there any chance to use Typed Persistence along with FSM actors?

smaiakov
  • 470
  • 5
  • 20
  • Also there is the following warning on [Akka Typed](https://doc.akka.io/docs/akka/2.5.16/typed/actors.html): `This module is currently marked as may change in the sense of being the subject of active research. This means that API or semantics can change without warning or deprecation period and it is not recommended to use this module in production just yet—you have been warned.` So we're kind of between a rock and a hard place here. Would be good to have some guidance from Lightbend on this. – Nathan Brown Sep 11 '18 at 10:49

1 Answers1

1

There are no "FSM Actors" in Akka Typed because it is inherently based on a state-machine model.

From the Akka Typed Documentation:

With untyped actors there is explicit support for building Finite State Machines. No support is needed in Akka Typed as it is straightforward to represent FSMs with behaviors.

In other words, you need to change your Akka FSM Actor into an Akka Typed Actor and then use the Akka Typed persistence framework.

Tim
  • 26,753
  • 2
  • 16
  • 29
  • Unfortunately I can't do that because TypedActors work in another way in cluster . If I do so I have to change cluster setup .... – smaiakov Sep 05 '18 at 07:11