akka remote actor running on local actor

220 Views Asked by At

I am learning akka-remote and trying to re-do http://www.typesafe.com/activator/template/akka-sample-remote-scala myself.

When I try to run the project in two separate JVMs, I see

$ clear;java -jar akkaio-remote/target/akka-remote-jar-with-dependencies.jar com.harit.akkaio.remote.RemoteApp ProcessingActor

ProcessingActorSystem Started

and

$ clear;java -jar akkaio-remote/target/akka-remote-jar-with-dependencies.jar com.harit.akkaio.remote.RemoteApp WatchingActor

WatchingActorSystem Started
asking processor to process
processing big things

I asked my Processing System to run on port 2552

include "common"
akka {
  # LISTEN on tcp port 2552
  remote.netty.tcp.port = 2552
}

and I told my other system (WatchingSystem) to run on port 2554 but start processingActor on port 2552

include "common"

akka {
  actor {
    deployment {
      "/processingActor/*" {
        remote = "akka.tcp://[email protected]:2552"
      }
    }
  }
  remote.netty.tcp.port = 2554
}

and common is about using the right provider

akka {
  actor {
    provider = "akka.remote.RemoteActorRefProvider"
  }

  remote {
    netty.tcp {
      hostname = "127.0.0.1"
    }
  }
}

Questions/Concerns

  1. From logs, I see that the processingActor is running on WatchingActorSystem and not on ProcessingActorSystem, what is wrong going on?
  2. How can I see that the two ActorSystems are connecting to each other. I do not see logging happening. However, in the example, I shared the logging happens. What am I missing?

The entire code is posted on Github and runs as well

1

There are 1 best solutions below

0
On

1) Your deployment configuration is set up to have all the children of processingActor being remote, as described in the akka configuration docs

You should set it to this instead:

deployment {
  "/processingActor" {
    remote = "akka.tcp://[email protected]:2552"
  }

2) You need to set your log level to something useful as described in the akka logging documentation