Persistence for akka FSM

377 views Asked by At

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?

1

There are 1 answers

1
Tim On

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.