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
package sample.eventdriven.scala | |
import akka.actor.{Actor, ActorRef, ActorSystem, Inbox, Props} | |
import akka.persistence.PersistentActor | |
import scala.concurrent.ExecutionContext.Implicits._ | |
import scala.concurrent.duration._ | |
// =============================================================== | |
// Demo of an Event-driven Architecture in Akka and 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
package sample.eventdriven.java; | |
import akka.actor.*; | |
import akka.persistence.AbstractPersistentActor; | |
import scala.concurrent.duration.Duration; | |
import java.io.Serializable; | |
import java.util.concurrent.TimeUnit; | |
import java.util.concurrent.TimeoutException; |
- Drift into Failure
- How Complex Systems Fail
- Antifragile: Things That Gain from Disorder
- Leverage Points: Places to Intervene in a System
- Going Solid: A Model of System Dynamics and Consequences for Patient Safety
- Resilience in Complex Adaptive Systems: Operating at the Edge of Failure
- Puppies! Now that I’ve got your attention, Complexity Theory
- [Towards Resilient Architectures: Biology
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
import akka.actor.SupervisorStrategy._ | |
import akka.actor._ | |
import akka.persistence.PersistentActor | |
import scala.concurrent.duration._ | |
// Coffee types | |
trait CoffeeType | |
case object BlackCoffee extends CoffeeType | |
case object Latte extends CoffeeType | |
case object Espresso extends CoffeeType |
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
import akka.actor._ | |
import akka.actor.SupervisorStrategy._ | |
import scala.concurrent.duration._ | |
// Coffee types | |
trait CoffeeType | |
case object BlackCoffee extends CoffeeType | |
case object Latte extends CoffeeType | |
case object Espresso extends CoffeeType |
I hereby claim:
- I am jboner on github.
- I am jonas (https://keybase.io/jonas) on keybase.
- I have a public key ASB-dCL3b2wk3TzgiVeoHmmp_s-ZM004MVmlztARjGu-pAo
To claim this, I am signing this object:
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
package demo | |
import akka.actor.{Actor, Props, ActorSystem} | |
object PingPong extends App { | |
case object Ball | |
class Ping extends Actor { | |
var counter = 0 |
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
package demo | |
import akka.actor.{Props, ActorSystem} | |
import akka.persistence.PersistentActor | |
object PingPong extends App { | |
case object Ball // The Command | |
case object BallReceived // The Domain Event, represents a Fact, something that have already happened | |
class Ping extends PersistentActor { |
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
# How Akka maps to EAI Patterns | |
Might be up for debate or just plain wrong. Just some notes I scribbled down some time ago. | |
----------------------------------------------------------------------------------------------------------------- | |
EAI PATTERN AKKA PATTERN REFERENCE | |
----------------------------------------------------------------------------------------------------------------- | |
Point to Point Channel Regular Actor Communication http://www.eaipatterns.com/PointToPointChannel.html | |
Event-Driven Consumer Regular Actor Receive http://www.eaipatterns.com/EventDrivenConsumer.html | |
Message Selector Actor with Stash http://www.eaipatterns.com/MessageSelector.html |
NewerOlder