@pthampi wrote:
Hi,
i am trying to follow the example provided on https://doc.akka.io/docs/akka/current/typed/guide/tutorial_1.html (Failure handling section). The java code doesn’t compile though.
private SupervisingActor(ActorContext<String> context) { super(context); child = context.spawn( Behaviors.supervise(SupervisedActor.create()).onFailure(SupervisorStrategy.restart()), "supervised-actor"); }
Compile error is
Error:(22, 25) java: no suitable method found for onFailure(akka.actor.SupervisorStrategy.Restart$) method akka.actor.typed.javadsl.Behaviors.Supervise.<Thr>onFailure(java.lang.Class<Thr>,akka.actor.typed.SupervisorStrategy) is not applicable (cannot infer type-variable(s) Thr (actual and formal argument lists differ in length)) method akka.actor.typed.javadsl.Behaviors.Supervise.onFailure(akka.actor.typed.SupervisorStrategy) is not applicable (argument mismatch; akka.actor.SupervisorStrategy.Restart$ cannot be converted to akka.actor.typed.SupervisorStrategy)
I searched online and no one has reported this.
Is this just me then?
Thanks, p
Posts: 2
Participants: 2