Hi Martynas, Thanks.
Just make sure that ShardResolver function resolves to the same Shard ID for messages meant for the corresponding PersistentActors and PersistentViews. [Prakhyat] Can you help me with code examples. How to make "ShardResolver function resolves to the same Shard ID for messages meant for the corresponding PersistentActors and PersistentViews"? I was looking at akka documentation. I could see a example which will help to create PersistentView for a PersistentActor. But there are no examples for sharding persistent view. For sharding with persistent actor we have below code, val shardRegion: ActorRef = ClusterSharding(system).start( 1. typeName = "PersistentActorXYZ", 2. entryProps = Some(Props[Counter]), 3. idExtractor = idExtractor, 4. shardResolver = shardResolver) To send messages we call ---> shardRegion ! "Message". The message will reach persistent actor based upon idExtractor and shardResolver. As I understand Persistent Views pull journaled events of persistent actors. We will not push or send any messages to views directly. How cluster sharding has to be used with view? Please share any code examples or articles to help me in this regard. -Prakhyat M M On Thursday, 9 October 2014 20:12:08 UTC+5:30, Martynas Mickevičius wrote: > > Hi, > > if you want to have PersistentViews ceated on the same node as > corresponding PersistentActors - use Cluster Sharding for PersistentViews > as well. Just make sure that ShardResolver function resolves to the same > Shard ID for messages meant for the corresponding PersistentActors and > PersistentViews. > > On Thu, Oct 9, 2014 at 9:46 AM, Prakhyat Mallikarjun <[email protected] > <javascript:>> wrote: > >> Team, >> >> We are taking approach of DDD with event sourcing(akka persistence). >> PersistentActors representing aggregate roots will be sharded by UUID. Also >> for query side we are planning to use views. >> >> One view will be implemented per PersistentActor. >> >> The persistent actor will be sharded based on UUID of aggregate roots and >> will be distributed across multiple nodes. The behavior is run time >> PersistentActors can be created in any clustered node. >> >> But what about the behavior of PersistentView? Will PersistentView's be >> created in same JVM as PersistentActor? Want to understand how >> PersistentView's >> will be created in distributed nodes when PersistentActor's are shaded? >> >> -Prakhyat M M >> >> -- >> >>>>>>>>>> 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] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at http://groups.google.com/group/akka-user. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Martynas Mickevičius > Typesafe <http://typesafe.com/> – Reactive > <http://www.reactivemanifesto.org/> Apps on the JVM > -- >>>>>>>>>> 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.
