Hi,
 
Tried by adding the default block. I am not getting the logs of that  block 
also.  It is not at all invoking the idExtractor.

Thanks
Asha

On Tuesday, 2 September 2014 17:40:04 UTC+5:30, √ wrote:
>
> Hi Prakhyat,
>
> I assume you've already tried this, but just for completeness, could you 
> do this:
>
> val idExtractor: ShardRegion.IdExtractor = {
>     case created: LedgerCreated =>{
>       println("%%%%%%%%% IdExtractor : " +created.ledgerId.id.toString)
>       (created.ledgerId.id.toString, created)
>     }
>     case edited: LedgerEdited   => (edited.ledgerId.id.toString, edited)
>     case deleted: LedgerDeleted => (deleted.ledgerId.id.toString, deleted)
>     case x =>
>       println("I'm matching on the wrong thing, I got a: " + x)
>       throw new IllegalStateException
>   }
>
>
> On Tue, Sep 2, 2014 at 2:02 PM, Prakhyat Mallikarjun <prakh...@gmail.com 
> <javascript:>> wrote:
>
>> Hi,
>>
>> We are following eventsourcing, DDD/CQRS approach. Single writer at the 
>> write side for persisting state. 
>> *Note*: Single writers are sharded by ID.
>>
>> We are using Akka-Work-Pull pattern of Typesafe in our application for 
>> processing.
>>
>> Jars included for akka persistence are akka-contrib_2.10-2.3.4.jar and 
>> akka-persistence-experimental_2.10-2.3.4.jar.
>>
>> Layers in the application are Front End, Master Work Allocator, Workers 
>> for processing. 
>>
>> Front End, Master, Worker are deployed on different nodes. The actor 
>> system of front end and  master is "*ClusterSystem*". The actor system 
>> of worker is "*WorkerSystem*". 
>>
>> Request form Browser is coming to Front end . Request flow,
>> Browser -> FrontEnd -> Master -> Worker
>>
>> Worker's pull the work from master and on successful processing persists 
>> state via sharded single writers.
>> *Note: Cluster Sharding is created with actor system *"*WorkerSystem*". 
>> Worker actors and Cluster Sharding have same*actor system *"
>> *WorkerSystem*".
>>
>> Below is the sharding code in PersistentActor.
>>  
>> val idExtractor: ShardRegion.IdExtractor = {
>>     case created: LedgerCreated =>{
>>       println("%%%%%%%%% IdExtractor : " +created.ledgerId.id.toString)
>>       (created.ledgerId.id.toString, created)
>>     }
>>     case edited: LedgerEdited   => (edited.ledgerId.id.toString, edited)
>>     case deleted: LedgerDeleted => (deleted.ledgerId.id.toString, deleted)
>>   }
>>
>>   val shardResolver: ShardRegion.ShardResolver = msg => msg match {
>>     case created: LedgerCreated =>{
>>        println("%%%%%%%%% ShardResolver : " +created.ledgerId.id 
>> <http://created.ledgerid.id/> % shards)
>>       (created.ledgerId.id <http://created.ledgerid.id/> % 
>> shards).toString
>>     }
>>     case edited: LedgerEdited   => (edited.ledgerId.id 
>> <http://edited.ledgerid.id/> % shards).toString
>>     case deleted: LedgerDeleted => (deleted.ledgerId.id 
>> <http://deleted.ledgerid.id/> % shards).toString
>>   }
>>
>> Messages are not reaching sharded PersistentActor neither reaching dead 
>> letter queue. 
>>
>> *But strange is we are getting the log written in the "shardResolver". 
>> But the log written in the "IdExtractor" is not displayed. Which means 
>> shard is getting resolved but there is an issue while locating persistent 
>> actor entry.*
>>
>> We are not able to figure out why message sent to shard is reaching the 
>> "shardResolver" 
>> block but doesn't reach "idExtractor" block.
>>
>> Kindly let us know what we are missing.
>>
>> -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 akka-user+...@googlegroups.com <javascript:>.
>> To post to this group, send email to akka...@googlegroups.com 
>> <javascript:>.
>> Visit this group at http://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Cheers,
> √
>  

-- 
>>>>>>>>>>      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 http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to