![]() Will always be very much application specific. Of exactly-once semantics is the responsibility of the Receiver. The Sender (other than the act of sending acknowledgements), achieving some sort Whereas at-least-once delivery is primarily the responsibility of Represents a person with a ticket entering a venue, and we need an accurateĬount of the number of people in attendance. Imagine if each of our messages from Sender to Receiver Processing messages more than once could go against the required business logic In some cases, at-least-once is sufficient. We’veĪchieved at-least-once delivery, which is what an Ack-Retry solution typically Now the Receiver has received more messages that the Sender intended. Let’s try this implementation, giving the Receiver an unreliable mailbox as before: The Sender Actor sends 100 messages, with a small delay between each: case object CountMe case object Finished class Sender ( receiver : ActorRef ) extends Actor with ActorLogging As an application increases in traffic or isĭistributed across more machines, the chances of failure increase significantly. Gets lost requires some form of failure that has never occurred. This is simply because a situation where a message That Akka provides exactly-once semantics. If you develop an application and run it on a single machine, or even clusteredĪcross multiple machines on a reliable network, you could get the impression So it is up to eachĪpplication to build on the underlying at-most-once provision in a way which is Justification for this is explained well by the classic post,Įssentially, the argument is that what it means to have at-least-once or exactly-onceĭelivery is specific to the business logic of an application. The same page explains that Akka offers the first level, at-most-once delivery. exactly-once delivery means that for each message handed to the mechanism exactly one delivery is made to the recipient the message can neither be lost nor duplicated.at-least-once delivery means that for each message handed to the mechanism potentially multiple attempts are made at delivering it, such that at least one succeeds again, in more casual terms this means that messages may be duplicated but not lost.at-most-once delivery means that for each message handed to the mechanism, that message is delivered zero or one times in more casual terms it means that messages may be lost.If not,ĭescribes three types of message delivery guarantee: This post assumes you a familiar with basic Akka programming in Scala. In this post, the delivery guarantee provided by Akka is explored by example,ĭemonstrating techniques for handling unreliable message delivery. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |