【发布时间】:2013-06-13 23:06:12
【问题描述】:
我正在使用 Akka 2.2-RC1,但无法让 Akka 从 application.conf 加载调度程序配置:
my-dispatcher {
type = PinnedDispatcher
executor = "thread-pool-executor"
}
akka.actor.deployment {
/test {
dispatcher = my-dispatcher
}
}
当从代码实例化时
val test = system.actorOf(Props[Test], "test")
根据日志,它仍在使用akka.actor.default-dispatcher。
当我将 .withDispatcher("my-dispatcher") 添加到 Props 时,一切正常,并且使用了 my-dispatcher。但我不喜欢将.withDispatcher(...) 添加到我的所有演员的想法...
有谁知道哪里出了问题?我在想演员路径可能是错误的,但 aplication.conf 路由配置工作正常(自定义 routee 调度程序除外)。
经过一些测试,我发现这个效果是由使用RemoteActorRefProvider引起的。一旦我禁用它并更改为默认值
akka.actor.provider = "akka.actor.LocalActorRefProvider"
调度程序从配置中正确配置。
我猜想启用远程处理后,Akka 会在别处寻找 Actor 调度程序的配置,或者远程 ref 可能有不同的逻辑路径?
【问题讨论】:
标签: configuration akka dispatcher