AKKA:对编程远程部署的困惑

AKKA: Confusion about programmatic remote deployment

我正在使用 akka remote deployment。我使用日志记录来确保参与者是否已成功远程部署。这是我的日志信息

[adaptiveCEP-akka.actor.default-dispatcher-18] [akka.tcp://adaptiveCEP@127.0.0.1:2555/remote/akka.tcp/adaptiveCEP@127.0.0.1:2554/user/disjunction/simple-2555-0.4631423946172286] hi, I am simple-2555-0.4631423946172286
[adaptiveCEP-akka.actor.default-dispatcher-18] [akka.tcp://adaptiveCEP@127.0.0.1:2555/remote/akka.tcp/adaptiveCEP@127.0.0.1:2554/user/disjunction/simple-2555-0.4631423946172286] hi, I am Actor[akka://adaptiveCEP/remote/akka.tcp/adaptiveCEP@127.0.0.1:2554/user/disjunction/simple-2555-0.4631423946172286#1386676347]

似乎演员 simple-2555-0.4631423946172286#1386676347disjunction 演员的子演员,并且都托管在同一台机器上(没有远程部署子演员)。而做监督的演员是actorakka.tcp://adaptiveCEP@127.0.0.1:2555

根据Top-Level Scopes for Actor Paths

"/remote" is an artificial path below which all actors reside whose supervisors are remote actor references

我是不是误会了什么?

如果需要

val randomRouter = actorSystem.actorOf(Props[Master],
      "disjunction")

Master.scala

val temp = context.actorOf(Props[SimpleClusterListener].withDeploy(Deploy(scope = RemoteScope(address))), "simple-" + port + "-" + Math.random())
temp ! "hi"

参考

Create an Akka actor remotely without a new ActorSystem

不,您的 actor 没有部署在本地,它在远程机器上

akka.tcp://adaptiveCEP@127.0.0.1:2555/remote/akka.tcp/adaptiveCEP@127.0.0.1:2554/user/disjunction/simple-2555-0.4631423946172286] hi, I am simple-2555-0.4631423946172286

此日志项显示您的演员 运行 在“127.0.0.1:2555”机器上的演员系统 "adaptiveCEP" 上,并且在 [=17] 中受到 "disjunction" 演员的监督=]