Last active
December 20, 2015 12:19
-
-
Save kachayev/6130353 to your computer and use it in GitHub Desktop.
Eventsourced and reliable channel in Scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Sender(receiverPath: String) extends Actor { | |
val id = 1 | |
val ext = EventsourcingExtension(context.system) | |
val proxy = context.actorOf( | |
Props(new DestinationProxy(receiverPath))) | |
val channel = ext.channelOf(ReliableChannelProps(1, proxy) | |
.withRedeliveryMax(1000) | |
.withRedeliveryDelay(1 second) | |
.withConfirmationTimeout(2 seconds)) | |
def receive = { | |
case msg: Message => { | |
sender ! s"accepted ${msg.event}" | |
channel forward msg | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment