Example projects
The following example projects can be downloaded. They contain build files and have instructions of how to run.
Quickstart
The Quickstart sample is described in Introduction to Actors and walks you through example code that introduces how to define actor systems, actors, and messages.
FSM
- Scala Dining hackers with FSM (akka-sample-fsm-scala.zip)
- Java Dining hackers with FSM (akka-sample-fsm-java.zip)
This project contains a Dining Hakkers sample illustrating how to model a Finite State Machine (FSM) with actors.
Cluster
- Scala Cluster example project (akka-sample-cluster-scala.zip)
- Java Cluster example project (akka-sample-cluster-java.zip)
This project contains samples illustrating different Cluster features, such as subscribing to cluster membership events, and sending messages to actors running on nodes in the cluster with Cluster aware routers.
It also includes Multi JVM Testing with the sbt-multi-jvm
plugin.
Distributed Data
- Scala Distributed data example project (akka-sample-distributed-data-scala.zip)
- Java Distributed data example project (akka-sample-distributed-data-java.zip)
This project contains several samples illustrating how to use Distributed Data.
Cluster Sharding
- Scala Cluster Sharding example (akka-sample-sharding-scala.zip)
- Java Cluster Sharding example (akka-sample-sharding-java.zip)
This project contains a KillrWeather sample illustrating how to use Cluster Sharding.
Persistence and CQRS
The Microservices with Akka tutorial contains a Shopping Cart sample illustrating how to use Event Sourcing and Projections together. The events are consumed by even processors to build other representations from the events, or publish the events to other services.
Replicated Event Sourcing
The Akka Distributed Cluster Guide illustrates how to use Replicated Event Sourcing that supports active-active persistent entities.
Kafka to Cluster Sharding
This project demonstrates how to use the External Shard Allocation strategy to co-locate the consumption of Kafka partitions with the shard that processes the messages.