Patrik,
     In our system I expect the actors to be created frequently and they'll 
be short lived in almost 90% of our use cases. The reason why I wanted 
control over the location in which an actor is created, is to minimize the 
overhead of passing messages across different machines and keep things 
local much as possible. Yes I did read about ShardAllocationStrategy and 
was wondering if there was entity level allocation strategy that I could 
override. 

Thanks,
Karthik

On Monday, December 14, 2015 at 10:13:40 AM UTC-8, Patrik Nordwall wrote:
>
> Heiko is right. If allocation at shard level is good enough for you, it’s 
> possible to use a custom ShardAllocationStrategy that cares about the 
> requester ActorRef:
>
> * @param requester actor reference to the [[ShardRegion]] that requested the 
> location of the
> *                  shard, can be returned if preference should be given to 
> the node where the shard was first accessed
>
> It is possible to use a one-to-one mapping between entity and shard to be 
> in full control for each actor, but that is not very scalable and it adds 
> additional latency for the first message for each entity.
>
> Cheers,
> Patrik
> ​
>
> On Mon, Dec 14, 2015 at 7:44 AM, Heiko Seeberger <loe...@posteo.de 
> <javascript:>> wrote:
>
>> Allocation happens at the shard level, i.e. for groups of actors, see 
>> `ShardCoordinator.ShardAllocationStrategy`. Therefore I don’t think you can 
>> achieve what you described.
>>
>> Heiko
>>
>> --
>>
>> *Heiko Seeberger*
>> Home: heikoseeberger.de
>> Twitter: @hseeberger <https://twitter.com/hseeberger>
>> Public key: keybase.io/hseeberger
>>
>> On 14 Dec 2015, at 01:05, Karthik Deivasigamani <kart...@gmail.com 
>> <javascript:>> wrote:
>>
>> Hi,
>>    I have been using cluster sharding feature in akka 2.4.1. I would like 
>> the sharding to be topology aware. For example : if I have a cluster with 
>> nodes - n1,n2,n3,n4. If my request goes to node n1 and if the entity actor 
>> does not exist in the cluster then it must create the entity actor on node 
>> n1 (basically same node where it received the request). Is there a way for 
>> me to control this behavior? Any pointers would be immensely helpful. 
>>
>> Thanks,
>> Karthik
>>
>> -- 
>> >>>>>>>>>> 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 akka-user+...@googlegroups.com <javascript:>.
>> To post to this group, send email to akka...@googlegroups.com 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> -- 
>> >>>>>>>>>> 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 akka-user+...@googlegroups.com <javascript:>.
>> To post to this group, send email to akka...@googlegroups.com 
>> <javascript:>.
>> Visit this group at https://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 akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to