Scala akka ActorFor path

2019-08-08 16:12发布

问题:

Here is my code for finding an actor on my remote system:

Application.system.actorFor("akka://ActorApplication@172.17.100.232:2552/home/louis/scala/remoteActor")

I think I have the wrong path specified.

Is this correct:

/home/louis/scala/

Is the location of the Play! project on the remote server. And then "remoteActor" is the name if the actor.

But it is never returning an ActorRef object, it is always null.

回答1:

no, the address should likely be:

"akka://ActorApplication@172.17.100.232:2552/user/remoteActor"

This assumes that ActorApplication is indeed the correct name for the actor system you are trying to access on :2552. The /user/ portion of the url indicates it is a actor you created in that system. (you being the "user")