I have an ActorSystem(e.g. A) which spawns other ActorSystem (e.g B). When B comes up, it knows the address of A and he executes cluster.join(). Once, the cluster is joined, actors can communicate with each other.
In my scenario:
As soon as "B" comes up and "A" gets a MemberUp message. I pick the ask temporary actorRef from DB and try to send a response back using something like
context.actorSelection("akka://ActorSystemA/temp/$a").resolveOne(3.seconds) ! Success
but it doesn't work. It always timesout
I tried adding a watch on the temp actor. The actor is not terminated, yet I cannot communicate.
Is this approach correct? Also, why I am getting timeout always.
It turns out that storing temporary references is a bad idea. You should never do it. I changed my design to get around this problem.