Example projects

The following example projects can be downloaded. They contain build files and have instructions of how to run.

Quickstart

Quickstart Guide Quickstart Guide

The Quickstart guide walks you through example code that introduces how to define actor systems, actors, and messages as well as how to use the test module and logging.

FSM

FSM example project FSM example project

This project contains a Dining Hakkers sample illustrating how to model a Finite State Machine (FSM) with actors.

Cluster

Cluster example project Cluster example project

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

Distributed Data example project Distributed Data example project

This project contains several samples illustrating how to use Distributed Data.

Cluster Sharding

Sharding example project Sharding example project

This project contains a KillrWeather sample illustrating how to use Cluster Sharding.

Persistence

Persistence example project Persistence example project

This project contains a Shopping Cart sample illustrating how to use Pekko Persistence.

Replicated Event Sourcing

Multi-DC Persistence example project Multi-DC Persistence example project

Illustrates how to use Replicated Event Sourcing that supports active-active persistent entities across data centers.

Cluster with Docker

Cluster with docker-compose example project Cluster with docker-compose example project

Illustrates how to use Pekko Cluster with Docker compose.

Cluster with Kubernetes

Cluster with Kubernetes example project Cluster with Kubernetes example project

This sample illustrates how to form a Pekko Cluster with Pekko Bootstrap when running in Kubernetes.

Distributed workers

Distributed workers example project

This project demonstrates the work pulling pattern using Pekko Cluster.

Kafka to Cluster Sharding

Kafka to Cluster Sharding example project

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.