I have the following issue in Akka-Java.

I have one Parent Actor `MainActor.class` and this parent has 5 child 
routes. Following is the hierarchy:

*My App => Main Actor => [Child Route-1,Child-Route-2,..]*

Simple Use case is String input is parsed to Integer as output: 

*MyApp ===ask[string input]===> Main Actor ==route==> Child(parses to 
Integer) === integer result===> Main Actor ===result==> MyApp*

Here is the Main Actor snippet:


 class MainActor extends UntypedActor{
    
       Router router;
       {
         // ...routes are configured here
       }
    
       public void onReceive(Object message){
         if(message instanceof String){
             router.route(message,self()); // route it to child
         }else if(message instanceof Integer){
            // received from child, 'tell' this result to actual 
sender/parent i.e, MyApp
            sender().tell(message,self()); 
         }else unhandled(message);
        }
 }

And Child Actor does nothing but String parsing to Integer and takes the 
result and sends it back to it's sender by 
`sender().tell(result,getContext().parent())`

*Issue*

MainActor is sending the Parsed integer result sent by child back to child 
itself instead of `MyApp`. I also tried replacing `*sender()*` to `
*getContext().parent()*` in `MainActor` but still it did not work.

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

Reply via email to