播放2.1.1不加载自定义Akka调度程序

时间:2013-04-20 21:09:52

标签: scala playframework akka playframework-2.1

我正在使用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
            }
        }
    }
}

我尝试在演员身上使用它:

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

据我所知,这似乎是添加它的正确方法。任何人都知道这是什么问题?

1 个答案:

答案 0 :(得分:7)

你必须把完整的配置值路径:withDispatcher(" akka.actor.rr-dispatcher")(或者甚至是#34; play.akka.actor.rr-dispatcher" )