Hi Jie Tang,

Regarding the discussion about having two connections from A to B, it might 
be a bug, please continue that in the thread that was already discussing 
this. 
(https://groups.google.com/forum/#!searchin/akka-user/connections/akka-user/GYkFfR_ISUI/LCuMDW0wDgAJ)

About the app you describe, it is hard to tell if can be improved without 
knowing more about the requirements and the system is supposed to do.

One thing to think about though, when you create a remote death watch you 
create a very tight coupling with the remote system, 
if there is a problem with the connection to the other system it will be 
marked as quarantined and it cannot come back from that state
but must be restarted. This is probably not what you want for your system, 
or at least something will have thought about
seriously before accepting.

akka-cluster handles such problems better and can allow nodes coming back 
from being unreachable.

--
Johan Andrén
Typesafe -  Reactive apps on the JVM
Twitter: @apnylle


On Wednesday, December 30, 2015 at 5:15:16 PM UTC+1, jie tang wrote:
>
> Hi ,all :
>     Process A connects to process B via Akka Remote.
>     There are two kinds of actors in process A:
>     (1)A single monitor actor watches a single manager actor in process B
>         If the monitor actor doesn't hold the ActorRef of the manager 
> actor, it sends a Identify message to process B via AskableActorSelection 
> every 10 seconds.
>         If the monitor actor gets ActorIdentity message, it holds the 
> ActorRef of the manager actor and watches it
>         If the monitor actor gets the Terminated message of the manager 
> actor, it resends Identify Message periodically until it gets ActorIdentity 
> message.
>     (2)Many client actors dynamically created.
>         Every client actor sends a message to the monitor actor in its 
> preStart method.
>          If the monitor actor holds the ActorRef of the manager actor in 
> Process B, it forwards the messages to the manager actor
>         The manager actor creates a server actor for every client actor 
> and returns the ActorRef of the server actor to the client actor
>         The client actor watches its server actor and talks to the server 
> actor directly.
>         If the client gets Terminated message of the server, it suicides.
>
>
>     When process B restarts to update, there may be two tcp connections 
> initiated from process A. I turned on akka log:
>     (1)Process A
>         Sending remote message ActorSelection(Identify(...))
>     (2)Process B
>         Receives  message ActorSelection(Identify(...))
>         Sending message ActorIdentity(...)
>     But Process A's log doesn't show "receives ActorIdentity message"
>
>     I guess the issue is about two tcp connections initiated from the same 
> process. 
>     Is it a bug? 
>     What I should do to avoid or work around that?
>     Or I can improve the communcation pattern between process A and 
> process B ?
>
>    Thanks very much.
>     
>

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