Skip to content

reypader/akka-cluster-sharding-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample Project for Akka Cluster with Persistence

Intended to demonstrate a working project with Akka Clusters and Persistence.

Implemented a sharded counter.

  • Given three nodes Node 1, 2, and 3
  • And three counters C1, C2, and C3 located in the node of the same number
  • When there's a request in (Node 3) to increment counter (C1)
  • Then (Node 3) should forward the processing to (Node 1)

To test:

  • Run three processes
$ sbt "runMain com.rmpader.gitprojects.MainApp1"
$ sbt "runMain com.rmpader.gitprojects.MainApp2"
$ sbt "runMain com.rmpader.gitprojects.MainApp3"
  • Send a cURL to the three servers for varying counters
$ curl http://localhost:8081/count/1
$ curl http://localhost:8081/count/2
$ curl http://localhost:8081/count/3
$ curl http://localhost:8082/count/1
$ curl http://localhost:8082/count/2
$ curl http://localhost:8082/count/3
$ curl http://localhost:8083/count/1
$ curl http://localhost:8083/count/2
$ curl http://localhost:8083/count/3

About

Sharded Counter using Akka Cluster Sharding

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published