Yes, the persistence IDs are unique for each persistence instance. Anything 
else you think I am missing?

Thanks for the quick response.

Qing

On Tuesday, February 7, 2017 at 1:26:45 AM UTC-8, Patrik Nordwall wrote:
>
> How have you defined the persistenceId in ActorA and ActorB? It must be 
> unique for each persistent actor instance.
>
> On Tue, Feb 7, 2017 at 8:39 AM, Qing Zheng <qzhe...@gmail.com 
> <javascript:>> wrote:
>
>> Hi,
>>
>>    I have two actor types
>>
>>    
>> class ActorA  extends UntypedPersistentActor {
>>   //....
>> }
>>
>>
>> class ActorB extends  UntypedPersistentActor {
>>   //....
>> }
>>
>> public static void main(String[] argv) {
>>   ActorSystem system = ActorSystem.create("ActorSystem", 
>> ConfigFactory.load(argv[0]));
>>   Persistence.apply(system);
>>   ClusterShardingSettings settings = 
>> ClusterShardingSettings.create(system);
>>   ClusterExtractor extractor = new ClusterExtractor();
>>
>>   ClusterSharding.get(system).start("ShardRegionA", 
>> Props.create(ActorA.class), settings, extractor);
>>   ClusterSharding.get(system).start("ShardRegionB", 
>> Props.create(ActorB.class), settings, extractor);
>>
>>   ActorRef shardRegionA = 
>> ClusterSharding.get(system).shardRegion("ShardRegionA");
>>   ActorRef shardRegionB = 
>> ClusterSharding.get(system).shardRegion("ShardRegionB");
>>
>>   //.....
>>
>>   Without calling persist.add method everything works as I expected. I 
>> can send a cluster message to shard region A or B and ActorA or ActorB will 
>> handle the corresponding message differently.However, after invoking the 
>> persist.add method. ActorA will receive recovery message for ActorB or 
>> maybe vice versa. Looks like the cluster messages that have been persisted 
>> do not have the shard region information. How can I solve this problem?
>>
>>   Thanks
>>   Qing
>>
>> -- 
>> >>>>>>>>>> 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
> Akka Tech Lead
> Lightbend <http://www.lightbend.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