Sto usando Play 2.1.1 e in application.conf
Aggiungo il seguente dispatcher personalizzato:
# 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
}
}
}
}
Provo ad usarlo su un attore:
private val default = Akka.system.actorOf(Props[MessageRouterActor].withRouter(FromConfig()).withDispatcher("rr-dispatcher"), "msgRouter")
Ma ricevo questo messaggio affermando che il dispatcher non può essere trovato:
[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
Per quanto ho visto, questo sembra essere il modo corretto per aggiungerlo. Qualcuno sa quale sia il problema?
risposte:
7 per risposta № 1Devi inserire il percorso completo del valore di configurazione: withDispatcher ("akka.actor.rr-dispatcher") (o forse anche "play.akka.actor.rr-dispatcher")