Search code examples
akkajava-11

path of ActorRef changed in receivers end


After creating the actor

actorRef.path().toString()

returns the path correctly akka://syst/user/ker/def

but when the same method called at the receivers end, $a or $c attached to the string as follows.

getSender().path().toString()

akka://syst/user/ker/def/$c

is this due to reboot of actor instance or due to any other reason? How to keep the path in actorref unique?


Solution

  • The "/$a" or "/$c" is indicating that you are receiving a child of the actor, rather than an actor itself. The additional "/" is indicating the child relationship. And the "$a" and "$c" are indicating that it's likely something autogenerated like a timer or (as Levi suggests) part of the ask pattern.

    You'd have to provide a code example to understand why you are receiving the child rather than the parent.