问题
I have some nested Router, which shall be created FromConfig()
. What I want is something like this:
test {
akka.actor.deployment {
/worker {
router = round-robin
nr-of-instances = 5
/slave {
router = broadcast
nr-of-instances = 4
}
}
}
}
But if I run this, I get an exception, telling me, that [akka://test/user/worker/slave]
needs external configuration and suggests application.conf.
The names are correct and without the nested routing it worked. What am I missing?
Edit
I tried another way to configurate:
test{
akka.actor.deployment {
/worker {
router = round-robin
nr-of-instances = 5
}
/worker/slave {
router = broadcast
nr-of-instances = 4
}
}
}
This isn't working neither. I also recognized, that the actual position of the error is not [akka://test/user/worker/slave]
, but [akka://test/user/worker/$a/slave]
. That makes it even more weired for me. I understand, that $a is a routee, but how can I configurate it?
Edit 2
Thank you for your quick replys. For me this does not work at all because I am using scala 2.9.2 and akka 2.0. Is there a way to achieve something similar in akka 2.0?
回答1:
You can use wildcard in the deployment path name: /worker/*/slave
来源:https://stackoverflow.com/questions/14302929/configurate-nested-router-in-akka