Typed actor references from Receptionist

I’m using akka 2.5.21, in Java.

After registering the actors (and also spawning them) to a Receptionist I tried to look them up in another class with Receptionist.Find message.

For this I created a temp actor with Receptionist.Listing behavior and invoked Receptionist.Find message, like this context.getSystem().receptionist().tell(Receptionist.find(myLookupServiceKey, this));

But the on the Receptionist.Listing response from Receptionist when I do .getServiceInstances(myLookupServiceKey) I get an empty set.

This seems like a simple way to find references to typed actor previously spawned elsewhere in the system, but looks a dead end :pensive:.

Appreciate any help.

The system is run in single node. But there are two actor systems, typed (used to spawn actors) and classic (used to start a HTTP server). The discovery was attempted in the REST controller class (not sure if that matters).

First, update to latest Akka version. That is 2.6.10 or 2.5.32

Thanks for your reply. In my application I’m bound by Scala 2.11, because this application also uses Spark which is on 2.3 in my Spark cluster. I couldn’t use latest Akka and Spark 2.3 clients as different Scala versions are not supported in same JVM.

As much as I want to upgrade the 2.5.21 is the highest version with Scala 2.11 for Akka typed.

You can compare with the test from that version: https://github.com/akka/akka/blob/v2.5.21/akka-actor-typed-tests/src/test/scala/akka/actor/typed/internal/receptionist/LocalReceptionistSpec.scala

Thanks again Patrik. Hopefully these test resources (I see the Java ones as well) should help.