In Akka 2.2.0 I have a round robin routed Actor which I want to have a custom dispatcher sitting over.
In my application.conf
I have;
durable-dispatcher {
mailbox-type = akka.actor.mailbox.filebased.FileBasedMailboxType
}
akka.actor.deployment {
/notificationServiceWorkers {
dispatcher = durable-dispatcher
router = round-robin
nr-of-instances = 5
}
}
Now when I try to create this actor like so;
ActorRef notificationServiceWorkers = akka.actorOf(Props.create(NotificationServiceActor.class)
.withRouter(new FromConfig()), "notificationServiceWorkers")
The dispatcher is not picked up from the config and it uses the default dispatcher.
If I remove the .withRouter
, Akka picks up the config for the dispatcher just fine but obviously its no longer routed.
If I add the .withDispatcher
like so;
ActorRef notificationServiceWorkers = akka.actorOf(Props.create(NotificationServiceActor.class)
.withDispatcher("durable-dispatcher")
.withRouter(new FromConfig()), "notificationServiceWorkers")
It all works. The question is (its not clear from the doco) if I want to load a dispatcher and router configuration from the application.conf then why do I need to supply both in the Props creation? Is this a bug?