我正在使用 Play 2.1.1 和 application.conf
我添加了以下自定义调度程序:
# Dispatcher for round-robin actors
play {
akka {
actor {
rr-dispatcher = {
type = BalancingDispatcher
executor = fork-join-executor
fork-join-executor {
parallelism-min = 2
parallelism-factor = 2
parallelism-max = 24
}
# messages per actor before jumping
throughput = 100
}
}
}
}
我尝试在 Actor 上使用它:
private val default = Akka.system.actorOf(Props[MessageRouterActor].withRouter(FromConfig()).withDispatcher("rr-dispatcher"), "msgRouter")
但是我收到这条消息,指出找不到调度员:
[info] play - Starting application default Akka system.
[WARN] [04/20/2013 22:05:12.069] [application-akka.actor.default-dispatcher-5] [Dispatchers] Dispatcher [rr-dispatcher] not configured, using default-dispatcher
据我所知,这似乎是添加它的正确方法。有谁知道是什么问题?
最佳答案
您必须放置完整的配置值路径: withDispatcher("akka.actor.rr-dispatcher") (甚至可能是“play.akka.actor.rr-dispatcher”)
关于scala - Play 2.1.1 未加载自定义 Akka 调度程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16125218/