What's the typed story of Cluster.registerOnMemberUp?

With Cluster.registerOnMemberUp one can defer creating the top level actor(s) until the system has become a member node, which is great.

In order to use Cluster.registerOnMemberUp one needs an untyped ActorSystem. With Akka Typed one can create a typed ActorSystem and then use the implicit conversions provided by akka.actor.typed.scaladsl.adapter. But in order to create a typed system, one has to provide the behavior of the top level actor (aka guardian). This means that the guardian is created early, before any code can be registered with Cluster.registerOnMemberUp.

Are there ideas/plans to resolve this for Akka Typed? I know that currently everything is based on the untyped system and hence I can work around this issue by starting with an untyped system. But what if typed becomes the one and only way?

We decided to not special case that with a runnable anymore, but instead use normal actor messaging. We introduced the message akka.cluster.typed.SelfUp which you can subscribe to through the typed cluster.

3 Likes

I missed that, but hey, that soulds excellent! Thanks!