Verify config override of router nr-of-instances. See #1607

* It wasn't a bug. I think the confusion came from config without 'router' defined.
* Added test
* Added some clarification to docs
This commit is contained in:
Patrik Nordwall 2012-01-10 17:50:17 +01:00
parent 0d4763c3b0
commit 762a6017e9
4 changed files with 34 additions and 5 deletions

View file

@ -44,8 +44,9 @@ You can also give the router already created routees as in:
When you create a router programatically you define the number of routees *or* you pass already created routees to it.
If you send both parameters to the router *only* the latter will be used, i.e. ``nrOfInstances`` is disregarded.
*It is also worth pointing out that if you define the number of routees in the configuration file then this
value will be used instead of any programmatically sent parameters.*
*It is also worth pointing out that if you define the number of routees (``nr-of-instances`` or ``routees``) in
the configuration file then this value will be used instead of any programmatically sent parameters, but you must
also define the ``router`` property in the configuration.*
Once you have the router actor it is just to send messages to it as you would to any actor:
@ -190,6 +191,8 @@ This is an example of how to programatically create a resizable router:
.. includecode:: code/akka/docs/routing/RouterViaProgramExample.scala#programmaticRoutingWithResizer
*It is also worth pointing out that if you define the ``router`` in the configuration file then this value
will be used instead of any programmatically sent parameters.*
Custom Router
^^^^^^^^^^^^^