Hello,
Here is the situation: I have two actor systems "systemA" and "systemB" started in different processes.
Actor system A starts before B, and doesn't do anything (B will deploy to A).
Actor system B starts and creates a router actor with a remotely-deployed routee, as follows:
val router = systemB.actorOf(FromConfig.props(Props[Receiver]), "receiver")
with configuration:
actor.deployment {
/receiver {
router = round-robin-pool
nr-of-instances = 1
target.nodes = [ "akka.tcp://systemA@localhost:2553" ]
}
(I'm only testing with 1 instance now, but there will typically be more in production)
The Receiver actor, in part:
class Receiver extends Actor {
val workerPool = context.actorOf(FromConfig.props(Props[Worker]), name = "workerPool")
...
}
what I'd like to use in the configuration for "workerPool" is this:
actor.deployment {
/receiver ... as above ...
"/receiver/*/workerPool" {
router = random-pool
nr-of-instances = 4
pool-dispatcher {
type = BalancingDispatcher
}
}
}
But this isn't working. Again, the idea is that systemB will deploy the "Receiver" actor to systemA (as part of the round-robin-pool), and in turn the receiver actor creates a worker pool of "Worker" actors that use a balancing dispatcher.
The error I see coming out of the process running "systemB" is:
16:29:44.477 [ERROR] - configuration problem while creating [akka://systemA/remote/akka.tcp/systemB@localhost:61012/user/receiver/c1/workerPool] with router dispatcher [akka.actor.default-dispatcher] and mailbox [akka.actor.default-mailbox] and routee dispatcher [akka.actor.default-dispatcher] and mailbox [akka.actor.default-mailbox]
akka.actor.ActorInitializationException: exception during creation
at akka.actor.ActorInitializationException$.apply(Actor.scala:164)
at akka.actor.ActorCell.create(ActorCell.scala:596)
Caused by: akka.ConfigurationException: configuration problem while creating [akka://systemA/remote/akka.tcp/systemB@localhost:61012/user/receiver/c1/workerPool] with router dispatcher [akka.actor.default-dispatcher] and mailbox [akka.actor.default-mailbox] and routee dispatcher [akka.actor.default-dispatcher] and mailbox [akka.actor.default-mailbox]
at akka.actor.LocalActorRefProvider.actorOf(ActorRefProvider.scala:752)
at akka.remote.RemoteActorRefProvider.actorOf(RemoteActorRefProvider.scala:297)
Caused by: com.typesafe.config.ConfigException$BadPath: path parameter: Invalid path 'akka.actor.deployment./akka.tcp/systemB@localhost:61012/user/receiver/c1/workerPool.pool-dispatcher': Token not allowed in path expression: '@' (Reserved character '@' is not allowed outside quotes) (you can double-quote this token if you really want it here)
at com.typesafe.config.impl.Parser.parsePathExpression(Parser.java:1057)
at com.typesafe.config.impl.Parser.parsePath(Parser.java:1097)
I also tried to configure the worker pool in code, as follows (based on the example
in the docs):
Note: for this I have removed the "/receiver/*/workerPool" configuration entry since I was defining it in code.
val workerPool = context.actorOf(
RandomPool(
nrOfInstances = 4,
routerDispatcher = "router-dispatcher"
).props(Props[Worker].withDispatcher("my-dispatcher")),
name = "workerPool"
)
with "my-dispatcher" defined as:
my-dispatcher {
type = BalancingDispatcher
}
but that also didn't work, with error:
17:10:43.257 [ERROR] - Dispatcher [my-dispatcher] not configured for router of akka://systemA/remote/akka.tcp/systemB@localhost:61412/user/receiver/c1/workerPool
akka.actor.ActorInitializationException: exception during creation
at akka.actor.ActorInitializationException$.apply(Actor.scala:164)
at akka.actor.ActorCell.create(ActorCell.scala:596)
Caused by: akka.ConfigurationException: Dispatcher [my-dispatcher] not configured for router of akka://systemA/remote/akka.tcp/systemB@localhost:61412/user/receiver/c1/workerPool
at akka.actor.LocalActorRefProvider.actorOf(ActorRefProvider.scala:735)
at akka.remote.RemoteActorRefProvider.actorOf(RemoteActorRefProvider.scala:297)
Have I uncovered a bug with the configuration, or is this expected behavior?
Thank you,
-Boris