Hi Konrad,

Thanks for your reply. I am aware of the confirmDelivery method. I left it out, 
because the crash prevents us from reaching it anyway. The case here is that 
the at least once delivery sends the message even when the actor crashes. 
Something which I didn't expect. I am sending a message to a Camel actor which 
sends an email (unfortunately the service I'm calling isn't idempotent). 

The question is: why does atLeastOnceDelivery send unconfirmed messages even 
when the actor crashes and the supervisor strategy is to stop the actor. Or 
when restart strategy is to restart 10x, the message is sent 10x.

Thanks,
Jeroen


Op vrijdag 17 oktober 2014 16:47:58 UTC+2 schreef Konrad Malawski:
> Hi Jeroen,
> Thanks for preparing the example, it made checking what the problem is very 
> simple :-)
> 
> 
> Try searching for `confirmDelivery` in your code snippet. It's not there.
> And with no confirmation, there is no information on in the sending-actor 
> that the target has really received the message.
> 
> 
> The interaction MUST be such that:
> 
> 
> 
> 
> [bob]                    [alice]
> m(1) -------------X                 # message lost!
> m(1) ------------------> got m(1)   # message got here
>        X---------------- confirm 1  # confirmation lost!
> 
>        # re-send triggers
> m(1) -------------------> got m(1)   # "oh, I know it already!"
> confirmDelivery(1) <----- confirm 1  # confirmation got to sender
> 
> 
> At least once delivery semantics imply two things:
> 1) the receiver must be ready to receive the message multiple times (should 
> simply ignore if it knows it already, or the messages should be idempotent). 
> 2) the sender must retry sending a message until it gets a confirmation back 
> from the receiver
> 
> 
> In your case you forgot the 2) rule.
> 
> 
> AtLeastOnceDelivery has helpers for this, in form of: confirmDelivery.
> Please read the example in the docs in detail: 
> http://doc.akka.io/docs/akka/snapshot/scala/persistence.html#at-least-once-delivery
> 
> 
> 
> 
> I would also highly recommend watching my or Endre's talks which are 
> * "without past or present" by Endre 
> http://letitcrash.com/post/83823246588/without-past-and-present
> * "distributed consensus aka. what do we eat for lunch" by me 
> http://letitcrash.com/post/98879157982/introduction-to-distributed-consensus-by-konrad
> They have videos and slides, I hope you'll enjoy it (great watch right in 
> time for a friday evening?)!
> 
> 
> 
> 
> 
> Happy hakking!
> 
> -- 
> 
> 
> Cheers,
> Konrad 'ktoso' Malawski
> 
> hAkker @ Typesafe

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