Questions tagged [akka-supervision]

In Akka supervision describes a dependency relationship between actors: the supervisor delegates tasks to subordinates and therefore must respond to their failures. When a subordinate detects a failure (i.e. throws an exception), it suspends itself and all its subordinates and sends a message to its supervisor, signaling failure.

104 questions
2
votes
1 answer

How to escalate top-most supervisors in Akka?

I have the following top-level (“parent-most”) actor: // Groovy pseudo-code class Master extends UntypedActor { ActorRef child1 ActorRef child2 ActorRef child3 ActorRef backup @Override void onReceive(Object message) throws…
smeeb
  • 27,777
  • 57
  • 250
  • 447
2
votes
1 answer

Designing Akka Supervisor Hierarchy

Please note: I am a Java developer with no working knowledge of Scala (sadly). I would ask that any code examples provided in the answer would be using Akka's Java API. I am brand-spanking-new to Akka and actors, and am trying to set up a fairly…
smeeb
  • 27,777
  • 57
  • 250
  • 447
2
votes
2 answers

How to send message from Supervisor to Actor once Actor restarts?

Requirement? - There has to be a long running process(daemon) that should run forever - In case of any exceptions, it should be restarted, but if it fails again twice, no restart efforts should be taken Problem I face? - The actor is restarted…
daydreamer
  • 87,243
  • 191
  • 450
  • 722
2
votes
1 answer

Passing ActorRef as Constructor argument

I am new to Akka and I am bulding a cluster system with many remote nodes. The remote nodes are called workers. Workers create chain of remote routers. The parent(Worker) which creates routers will have a stats watcher who will get message from all…
Harshjags
  • 163
  • 1
  • 2
  • 12
2
votes
1 answer

Akka: Testing Supervisor Recommendations

I am very new to Akka and using Java to program my system. Problem definition - I have a TenantMonitor which when receives TenantMonitorMessage(), starts a new actor DiskMonitorActor. - The DiskMonitorActor may fail for various reasons and may…
daydreamer
  • 87,243
  • 191
  • 450
  • 722
2
votes
2 answers

How to determine Akka actor/supervisor hierarchy?

I am brand new to Akka (Java lib, v2.3.9). I am trying to follow the supervisor hierarchy best practices, but since this is my first Akka app, am hitting a mental barrier somewhere. In my first ever Akka app (really a library intended for reuse…
smeeb
  • 27,777
  • 57
  • 250
  • 447
2
votes
1 answer

Is dead letter box reusable in akka?

I've made following code: package com.star.wars import akka.actor._ import akka.actor.SupervisorStrategy._ import akka.util.duration._ object Test extends App { case object Kill case object Create class Luke extends Actor { var x: Int…
Scony
  • 4,068
  • 1
  • 16
  • 23
2
votes
1 answer

Schedule restart of Akka actor

Is anyone aware of a way to create a SupervisorStrategy that executes a Restart of an Actor after a delay? To provide some context I have an actor that queries a DB on startup. If the DB connection is down the Actor will spin until it hits the max…
healsjnr
  • 405
  • 3
  • 10
2
votes
1 answer

In akka 2.x, is root actor supervised by someone else?

Reading the Akka doc : http://doc.akka.io/docs/akka/2.2.3/AkkaScala.pdf its states in section 2.2.1 Hierarchical Structure The only prerequisite is to know that each actor has exactly one supervisor, which is the actor that created it. But at the…
blue-sky
  • 51,962
  • 152
  • 427
  • 752
2
votes
2 answers

Akka 2.1 exception handling (Scala)

I have a supervising Akka actor which uses a router to forward messages to worker actors. I have a class which wraps the supervisor and when I call a method on that class it "asks" the supervisor to do something and then I use…
John Smith
  • 3,037
  • 5
  • 29
  • 31
1
vote
0 answers

Delayed Restart is not working while using BackoffSupervisor in Akka Classic Actors (Scala)

I'm trying to use BackoffSupervisor to delay the restart. I've given 10.sec as minimum backoff but on Exception it is restarting the actor immediately. Here is code: `object Task2Implementation extends App { val system = ActorSystem("system") …
1
vote
2 answers

Akka - Why are stashed messages with backoff supervision lost?

Question I seem to be observing a scenario in which the messages stashed for a typed supervised actor are lost during a restart, using the Akka backoff supervision strategy. Is this expected behavior? If not, how can I implement ensure these stashed…
havenwang
  • 153
  • 9
1
vote
1 answer

How do I get exception details from an Akka Supervisor?

I'm testing how a new Actor I'm working on handles unexpected messages. I'd like to assert that it throws a GibberishException in these cases. Here's the test and the implementation so far: Test: """throw a GibberishException for unrecognized…
traffichazard
  • 1,247
  • 1
  • 9
  • 13
1
vote
1 answer

How to specify role at node level within Akka cluster?

Given the following appliction.conf : akka { loglevel = debug actor { provider = cluster serialization-bindings { "sample.cluster.CborSerializable" = jackson-cbor } } remote { artery { canonical.hostname =…
blue-sky
  • 51,962
  • 152
  • 427
  • 752
1
vote
1 answer

Can a BackoffSupervisor have multiple children actors?

All my actors inherit from BaseActor and can create children actor with registerActor() abstract class BaseActor() : AbstractLoggingActor() { protected fun registerActor(childProps: Props, name: String): ActorRef { val child =…
Lorenzo Belli
  • 1,767
  • 4
  • 25
  • 46