Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Play 2.1.1 not loading custom Akka dispatcher

I'm using Play 2.1.1 and in application.conf I add the following custom dispatcher:

# 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
            }
        }
    }
}

I try to use it on an actor:

private val default = Akka.system.actorOf(Props[MessageRouterActor].withRouter(FromConfig()).withDispatcher("rr-dispatcher"), "msgRouter")

But I get this message stating the dispatcher couldn't be found:

[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

As far as I've seen this seems to be the correct way to add it. Anyone knows what's the issue?

like image 680
Pere Villega Avatar asked Apr 20 '13 21:04

Pere Villega


1 Answers

You have to put the full config value path: withDispatcher("akka.actor.rr-dispatcher") (or perhaps even "play.akka.actor.rr-dispatcher")

like image 71
Viktor Klang Avatar answered Oct 23 '22 21:10

Viktor Klang