Search code examples
scalaakka-clusterakka-remote-actorakka-remoting

AKKA: Confusion about programmatic remote deployment


I am using akka remote deployment. I used logging to ensure if the actor has successfully deployed remotely. Here is my log info

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

It appears as if actor simple-2555-0.4631423946172286#1386676347 is child actor of disjunction actor and both hosted on the same machine (no remote deployment of child). And the actor who is doing supervision is actor akka.tcp://[email protected]:2555.

According to Top-Level Scopes for Actor Paths:

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

Have I misunderstood something?

If required

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"

Reference

Create an Akka actor remotely without a new ActorSystem


Solution

  • No, your actor is not deployed locally, it's on the remote machine

    akka.tcp://[email protected]:2555/remote/akka.tcp/[email protected]:2554/user/disjunction/simple-2555-0.4631423946172286] hi, I am simple-2555-0.4631423946172286
    

    This log item shows that your actor is running on actor system "adaptiveCEP" on "127.0.0.1:2555" machine and is being supervised by "disjunction" actor in "[email protected]:2554"