Questions tagged [akka-fsm]

Akka FSM is a framework for explicitly defining Akka actors in the form of an finite-state machine.

Akka FSM is a framework for explicitly defining Akka actors in the form of an finite-state machine, which is the native paradigm for describing the actor model in the academic literature. It's roughly equivalent to using Akka's lower-level behavior changes, but tends to emphasize actor behaviors resulting in immutable descriptions of state and date, instead of explicitly mutating actor-local state. Instead of using the receive method, actor behavior is defined using a FSM DSL that declaratively describes state behaviors and transitions.

18 questions
4
votes
1 answer

Akka FSM Actor with stashing and unstashing

I would like to do stashing/unstashing with FSM Akka Acctor. I don't know where to put the stash() and unstashAll(). I have a simplified example below: import akka.actor.{ActorSystem, FSM, Props, Stash} trait TestState case object StateA extends…
Rohit
  • 127
  • 1
  • 10
4
votes
4 answers

Entry actions with Akka FSM

Any state machine of reasonable complexity requires some entry actions to be performed upon entry to a state. For instance, UML State Machine diagrams have a special action for this purpose. Unfortunately I don't see how I can model such entry…
Jacob Eckel
  • 1,633
  • 1
  • 13
  • 22
3
votes
1 answer

Persistence for akka FSM

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…
smaiakov
  • 470
  • 5
  • 20
2
votes
1 answer

Updating data in a Finite state machine

I am using the FSM framework with AKKA using its Java API to manage state transitions . Here is the relevant portion of the state machine when(QUEUED, matchEvent(Exception.class, Service.class, (exception, dservice)…
user_mda
  • 18,148
  • 27
  • 82
  • 145
2
votes
1 answer

Can I mix Persistent FSM and at-least-once-message delivery in Akka

Akka provides A Persistent Actor with at-least-once message deliver (link) A Persistent FSM (link) Can I mix the two? I want to be able to maintain a persistent state machine, but also have stage changes trigger events which send messages to…
EugeneMi
  • 3,475
  • 3
  • 38
  • 57
1
vote
1 answer

object testkit is not a member of package akka

I am trying to run the example code of Akka FSM but I've met some error [info] Loading project definition from /home/akka/fsm/project [info] Loading settings for project root from build.sbt ... [info] Set current project to fsm (in build…
Liu Weibo
  • 434
  • 5
  • 16
1
vote
0 answers

AKKA FSM in spark streaming

I have a requirement to create state machine implementation in my spark streaming application. After reading thru some posts found AKKA comes with FSM out of the box. I created a simple AKKA FSM and I am able to run it locally. I am not sure how to…
Nats
  • 179
  • 2
  • 13
1
vote
1 answer

Using AKKA FSM with many concurrent instances

Looking for a bit of sage advice please. I have a simple order management FSM with half a dozen states. I am spec'ing my system to support 10K orders an hour peak. Each order will take between 10 to 120 seconds to traverse the FSM. Some transitions…
rick.it.2004
  • 231
  • 4
  • 11
1
vote
0 answers

Testing Akka Persistent FSM Actor with the applying method

I am trying to develop an FSM model in AKKA using its Java api. I wish to unit test this feature. I have gone through numerous examples on unit testing Akka FSM actors with lambda support but i couldn't find any relevant example which tests the…
1
vote
0 answers

Akka FSM Testkit doesn't catch *starting state* correctly

I am using Akka FSM to simulate a moving elevator (you are going: not again! :-)) and trying to test the FSM using regular Testkit features, but there seems to be a gap either in my understanding or the published behaviour of FSM (or both). Here's…
Nirmalya
  • 717
  • 9
  • 19
1
vote
1 answer

Is it safe to override `receive` in an Akka FSM?

I created an FSM with Akka. However, my FSM doesn't only get messages passed that are relevant for its FSM state. Its children may also pass ActorRefs up to it, which my FSM should then pass further up to its parent. Since FSMs in Akka are…
typeduke
  • 6,494
  • 6
  • 25
  • 34
0
votes
2 answers

Akka Finite State Machine and how to protocol Behaviors.unhandled?

I have a question about Behaviors.unhandled, I know that Akka sends the unhandled message to the Dead Letter and with the following configuration it also logs it akka { loglevel = "DEBUG" actor { debug { # enable DEBUG logging of unhandled…
posthumecaver
  • 1,584
  • 4
  • 16
  • 29
0
votes
1 answer

Akka FSM: How to write test case to verify state change?

I am working with Akka FSM. I have implemented state change with AbstractFSMWithStash. But I am not sure how to write a unit test case to verify that the actor changes its state. Does Akka provide any methods to access the state of the actor for…
Karan Khanna
  • 1,947
  • 3
  • 21
  • 49
0
votes
1 answer

Does the AKKA FSM support Java 7?

I am learning the FSM framework provided by AKKA using its JAVA API, so far I've come across examples using Lambda expressions that are supported with Java8 onwards. Is Java 8 a requirement? Can I use FSM with Java 7? If yes, are there any examples…
user_mda
  • 18,148
  • 27
  • 82
  • 145
0
votes
1 answer

How to make size based throttler using akka fsm?

I have a use case that i have to process the request using akka fsm as soon as number of request reaches to specified value. sealed trait State case object Idle extends State case object Active extends State sealed trait Data case object…
Mahesh Chand
  • 3,158
  • 19
  • 37
1
2