On Tue, Apr 22, 2014 at 1:53 AM, mtsui <[email protected]> wrote:

> Hi,
>
> How do you configure ClusterRouterGroup and ClusterRouterGroupSettings in
> Spring using the activator template akka-java-spring?
>
> Is there a way to create the cluster router ref  for the following in
> SpringExtProvider from the template?
>
>
>    1. int totalInstances = 100;
>    2. Iterable<String> routeesPaths = Collections
>    3. .singletonList("/user/statsWorker");
>    4. boolean allowLocalRoutees = true;
>    5. String useRole = "compute";
>    6. ActorRef workerRouter = getContext().actorOf(
>    7. new ClusterRouterGroup(new ConsistentHashingGroup(routeesPaths),
>    8. new ClusterRouterGroupSettings(totalInstances, routeesPaths,
>    9. allowLocalRoutees, useRole)).props(), "workerRouter2");
>
>
>
>
> For example, in the template, you can create an ActorRef below. How do you
> do the same for a router in cluster?
>
>     ActorSystem system = ctx.getBean(ActorSystem.class);
>     // use the Spring Extension to create props for a named actor bean
>     ActorRef counter = system.actorOf(
>       SpringExtProvider.get(system).props("CountingActor"), "counter");
>

I think you can add another props method in SpringExtProvider that
constructs the Props with the router settings.

Most things for routers can be defined in configuration, and then you
use FromConfig.getInstance().props().

For the above example I don't see why you would create the router via
SpringExtProvider. What do you want to inject, and into what?

Regards,
Patrik


>
>
>
>  --
> >>>>>>>>>> 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
JOIN US. REGISTER TODAY! <http://www.scaladays.org/>
Scala <http://www.scaladays.org/>
Days <http://www.scaladays.org/>
June 16th-18th, <http://www.scaladays.org/>
Berlin <http://www.scaladays.org/>

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