1. Levelling up in Akka
Building an MMOG server
Ajay Viswanathan, Sr. Software Engineer, Sigmoid
2. Intro to Akka
• The actor model
• Actor systems
• Messaging patterns
• Supervision of actors
• Handling state in Akka
• FSM in Akka
3. Akka Persistence
• Incoming messages plus current state abstracted as events
• Each event written to pluggable journal
• Events could be manually or auto-persisted
• Snapshot feature for faster recovery times
4. Akka Streams
• Generic abstraction for handling a wide variety of data I/O
• Basic stream is made up of Source -> <Flows> -> Sink
• Flows are composable
• DSL for creating complex graph flows
5. Akka Remote
• Allows an actor running on another JVM and ActorSystem to
communicate
• TCP/UDP communication available out of the box with Akka
6. Akka Cluster
• Allows actors running on multiple JVMs to form a shared actor entity
• New actors register with defined seed nodes
• Alternative is to use routers and a coordinating actor to handle loads
using a particular strategy (Round-Robin by default)
• Sharding API for granular selection of cluster actors for handling
loads
7. Akka HTTP
• For communicating with 3rd party services
• HTTP and WS protocol support out of the box
• Simple DSL for defining routes and integration with Streams
8. Akka Testkit
• Allows peeping inside actor for testing state
• Provides convenient TestProbe object for simplified testing simple
actors and FSM actors
• DSLs for testing HTTP routes and streams
9. Demo
• Modelling Housie (Tambola) as an FSM
• Connecting clients via websocket server
• Broadcast and reply messaging patterns
• Handling of Streams via custom protocol
• Persisting game events
• Repo link - https://github.com/ajatix/akka-housie