Hi Patrick,

Sorry for not being very clear.
I am using Akka together with Play.  I have two Play applications that both 
create actors.  These actors use Akka remote to communicate with each 
other.  During my initial tests, I was launching the play applications 
using "sbt run" and when I was closing one Play application, the other 
crashed with the [error] a.r.EndpointWriter - AssociationError that I 
described in my initial post.  This problem disappears when I compile the 
apps instead of launching them from sbt.

Once this initial "problem" solved, I still needed to detect when the 
connection to the remote actor is lost, this problem was solved by 
subscribing to the right event stream.

Best,

David 



On Friday, April 14, 2017 at 6:17:34 PM UTC+2, Patrik Nordwall wrote:
>
> but I'm still confused by that you say that something crash, what is it 
> that stops working?
> fre 14 apr. 2017 kl. 13:52 skrev David <[email protected] <javascript:>
> >:
>
>> Thanks Arnout.  It totally works.
>>
>> I solved my problem by adding the following to actor1:
>>
>>     override def preStart: Unit =
>>
>>     {
>>
>>         super.preStart()
>>
>>         context.system.eventStream.subscribe(self, classOf[akka.remote.
>> DisassociatedEvent])
>>
>>     }
>>
>>
>> Then I just had to add and entry for DisassociatedEvent in receive to 
>> trigger the behavior I wanted
>>
>>
>>     override def receive =
>>
>>     { 
>>
>>         case event: akka.remote.DisassociatedEvent => {
>>
>>             ???
>>
>> Best,
>>
>> David
>>
>> On Friday, April 14, 2017 at 10:48:12 AM UTC+2, Arnout Engelen wrote:
>>>
>>> On Fri, Apr 14, 2017 at 10:39 AM, David <[email protected]> wrote:
>>>
>>>> I am still interested in knowing if there is a way for the system1 
>>>> application to be notified of the akka.remote.ShutDownAssociation event so 
>>>> that it can trigger some cleanup after losing the remote actor.  Looking 
>>>> at 
>>>> the log, all the information needed is there but how can I access it?
>>>>
>>>
>>> I think you can subscribe to association errors using 
>>> http://doc.akka.io/docs/akka/current/scala/remoting.html#Remote_Events
>>>
>>>
>>> Kind regards,
>>>
>>> Arnout
>>>  
>>>
>>>> On Sunday, April 9, 2017 at 2:24:57 PM UTC+2, Patrik Nordwall wrote:
>>>>>
>>>>> system1 doesn't crash, that is just a harmless log message, or do you 
>>>>> see anything that actually doesn't work in system1 after that?
>>>>>
>>>>> /Patrik
>>>>> sön 9 apr. 2017 kl. 13:25 skrev David <[email protected]>:
>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> I am using Akka remote 2.4.17 with Scala 2.12.1
>>>>>>
>>>>>> I have two actor systems: system1 and system2 
>>>>>>
>>>>>> An actor1 is created on system1 and an actor2 is created on system2
>>>>>>
>>>>>> actor2 looks up actor1 and they exchange messages.
>>>>>>
>>>>>> At some point, I shut down system2 and system1 crashes with the 
>>>>>> following error message:
>>>>>>
>>>>>> [error] a.r.EndpointWriter - AssociationError [akka.tcp://
>>>>>> [email protected]:2552] <- [akka.tcp://[email protected]:2553]: 
>>>>>> Error [Shut down address: akka.tcp://[email protected]:2553] [
>>>>>> akka.remote.ShutDownAssociation: Shut down address: akka.tcp://
>>>>>> [email protected]:2553
>>>>>> Caused by: 
>>>>>> akka.remote.transport.Transport$InvalidAssociationException: The remote 
>>>>>> system terminated the association because it is shutting down.
>>>>>> ]
>>>>>>
>>>>>> What should I to ensure that system1 stays up and running when 
>>>>>> system2 goes down?
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> David
>>>>>>  
>>>>>>
>>>>>> -- 
>>>>>> >>>>>>>>>> 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.
>>>>>>
>>>>> -- 
>>>> >>>>>>>>>> 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.
>>>>
>>>
>>>
>>>
>>> -- 
>>>
>> Arnout Engelen
>>> *Senior Software Engineer*
>>> E: [email protected]
>>> T: https://twitter.com/raboofje
>>>
>>>
>>> -- 
>> >>>>>>>>>> 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] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

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