Hi,

First, I agree that this is confusing, and we have an issue for improving
it: https://github.com/akka/akka/issues/13802

On Sun, Oct 19, 2014 at 6:26 PM, Eric Zoerner <[email protected]>
wrote:

> I am trying to understand how to configure a Cluster Aware Router with a
> Group of Routees.
> However, I am confused by the sample configuration in the Akka
> documentation.
> I don't understand the purpose of the configuration property
> nr-of-instances in the case of a router with a group of routees, whether
> it is cluster-aware or not.
>
> On this page:
> Cluster Usage
> <http://doc.akka.io/docs/akka/2.3.6/scala/cluster-usage.html>, under
> "Router with Group of Routees", it states:
>
> nr-of-instances defines total number of routees in the cluster. Setting
>> nr-of-instances to a high value will result in new routees added to the
>> router when nodes join the cluster.
>
>
> How can that be when, as per the same documentation,
>
> When using a Group you must start the routee actors on the cluster member
>> nodes. That is not done by the router.
>
>
> Futhermore, in the sample configuration, it shows both nr-of-instances
> *and* routees.paths properties being set.
>
>
nr-of-instances is actually used for a cluster aware group router. It is an
upper limit of the total number of routees that will be used. If you set it
to 10 and  routees.paths contains 1 path there will be one routee per node,
up to 10 nodes. When you add the 11th node to the cluster it will not be
used in the group router.

Normally, I don't think there is a need for such a limit, so setting it to
a large number (100000) makes sense.

What I described so far has nothing to do with the creation of the routee
actor. You have still to create the group routee yourself. The group router
is only using the path that was given and send the messages to that path
using actor selection.



>  According to the Reference Configuration
> <http://doc.akka.io/docs/akka/2.3.6/general/configuration.html#config-akka-cluster>,
> it states:
>
>
>>    1. # number of children to create in case of a router;
>>    2. # this setting is ignored if routees.paths is given
>>    3. nr-of-instances = 1
>>    4.
>>
>>
> Thus the nr-of-instances is ignored if routees.paths is given — which
> makes total sense.
>
>
Yes, here it gets really confusing. It was a mistake to "reuse"
the nr-of-instances property for cluster aware router configuration.

Cheers,
Patrik


> Is this an oversight in the documentation or am there something I am
> missing?
>
> This same sample configuration, by the way, is also present in the
> akka-sample-cluster-scala activator template where is also has both of
> these properties configured.
>
>
>  --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Patrik Nordwall
Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
Twitter: @patriknw

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to