On Sat, May 31, 2014 at 4:56 AM, Eugene Dzhurinsky <[email protected]>
wrote:

> Hello!
>
> I have a cluster with set of FSM actors deployed there. I also have a
> *ClusterClient* configured to send a message to the dedicated actor
> service, which then processes the passed data and now it has to *respond
> to the sender*.
>
> Like, actor *Client* sends a message to the cluster, which is routed
> through the *ClusterClient* and is delivered to the *WorkerFSM*, now the
> *WorkerFSM* processes the message and has to send the result back to the
> *Client*.
>
> But the *sender()* method in *WorkerFSM* will return the reference to
> *ClusterClient* - not
> *Client.*
>

That is surprising. The ClusterClient is using forward so the original
sender is passed on to the ClusterReceptionist, which creates a "response
tunnel" actor. Your WorkerFSM should see that response tunnel as sender. It
has the same name as the client actor, but is a child of the
ClusterReceptionist. When you reply to that sender the message will be
routed back to that response tunnel, and then back to the client. The
reason for this is to avoid inbound connections from other cluster nodes to
the client.

Are you using Akka version 2.3.3?

/Patrik


>
> How do I know which actor has been sending the message to the cluster?
>
> Thanks!
>
> --
> >>>>>>>>>> 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.
>



-- 

Patrik Nordwall
Typesafe <http://typesafe.com/> -  Reactive apps on the JVM
Twitter: @patriknw

<http://typesafe.com/go-reactive-activator-contest>

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