# Supervision Java example wrong

**URL:** <https://discuss.akka.io/t/supervision-java-example-wrong/5268>\
**Category:** Akka Libraries\
**Created:** [October 20, 2019, 3:05pm UTC](https://discuss.akka.io/t/supervision-java-example-wrong/5268 "2019-10-20T15:05:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![missourian55](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/missourian55/32/474_2.png) [@missourian55](https://discuss.akka.io/u/missourian55)\
**Post date:** [October 20, 2019, 3:05pm UTC](https://discuss.akka.io/t/supervision-java-example-wrong/5268/1 "2019-10-20T15:05:23Z")

</div>

Trying to understand the supervision strategy of Akka based on this Lightbend article. It seems the article not following the Akka rules

[https://developer.lightbend.com/start/?group=akka&project=akka-samples-supervision-java](https://developer.lightbend.com/start/?group=akka&project=akka-samples-supervision-java)

1. It has a Parent actor named “ArithmeticService” with SupervisorStrategy defined in it.
2. Parent in #1 create a child actor named “FlakyExpressionCalculator” and it too has its own SupervisorStrategy defined in it

But SupervisorStrategy defined in # 2 is not taking effect, child actor is always escalating the exception to parent and its up to the parent to decide what to do next. This kind of makes sense after reading the rules  
supervision here

> **[Supervision and Monitoring • Akka Documentation](https://doc.akka.io/docs/akka/current/general/supervision.html)**
>
> Hierarchical supervision, lifecycle monitoring and error or failure handling in Akka.

> 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.

**Tested with Akka 2.5.26**

---

<div class="post-metadata">

**Author:** ![johanandren](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/johanandren/32/85_2.png) [@johanandren](https://discuss.akka.io/u/johanandren)\
**Post date:** [October 21, 2019, 6:53am UTC](https://discuss.akka.io/t/supervision-java-example-wrong/5268/2 "2019-10-21T06:53:05Z")

</div>

Thanks for letting us know, that definitely looks strange.

I’ve created an issue to track that over in the samples repo: [https://github.com/akka/akka-samples/issues/131](https://github.com/akka/akka-samples/issues/131)
