The sender of the message which signified the method invocation will always be a temporary actor generated by the “ask” pattern, e.g. .../temp/$a
. The reason is that it is not an actor which receives the reply but some internal entity which then returns the reply value as the method invocation return value. Hence no matter how it is implemented, you will never see the ref of the actor enclosing the method’s call site as the sender.
On a side note: I cannot reproduce your findings (i.e. that the sender was .../user/$a
or similar), but you also did not specify which version of Akka you are using.