Hey Nan,

There might be a couple of things that you can do here:

1. If you know the id's of all of your entries, then it would be a matter 
of looping through these id's and sending each one the message you're 
trying to broadcast:

ie. in Java 8

   1. ActorRef counterRegion = ClusterSharding.get(system).shardRegion("Foo"
   );
   2. 
   3. List<String> entryIds = getEntryIds();
   4. 
   5. entryIds.forEach(id -> counterRegion.tell(new EnvelopeMessage(id, 
   payload), getSelf()));


2. The alternative to this would be to use cluster pub/sub and have your 
entry class subscribe to a particular topic. To broadcast you would simply 
publish your message to the same topic.

Luis


On Monday, November 3, 2014 7:27:45 AM UTC-8, Nan Zhu wrote:
>
> Hi, all
>
> I have some questions about cluster sharding
>
> it seems that cluster sharding does not provide the ability to broadcast a 
> particular message to all entries for a shard (other messages should be 
> delivered to a specific entry)?
>
> In my use case, I need the auto sharding capacity provided by cluster 
> sharding (especially move shard from one region to another for load 
> balancing),
>
> my questions are 
>
> 1. is it possible to broadcast some of the messages to all entries in 
> cluster sharding?
>
> 2. If the answer to 1 is not, what's the other pattern I can use to 
> achieve both auto-sharding (with some manual implementation) and broadcast 
> message to entries?
>
> Thank you very much!
>
> Best,
>
> Nan
>

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