How to do it...

  1. Bring the required dependencies to begin with.
  2. Edit the build.sbt file and add the Akka distributed data dependencies as follows:
        libraryDependencies += "com.typesafe.akka" %           "akka-distributed-data-experimental_2.11" % "2.4.17"

Then run sbt update to retrieve the dependencies from the central repository.

  1. Start coding SubscriptionManager. Create a file named SubscriptionManager.scala in the com.packt.chapter7 package with the following contents:
        package com.packt.chapter7        import akka.actor.{Actor, ActorRef, Props}        import akka.cluster.Cluster        import akka.cluster.ddata._        import akka.cluster.ddata.Replicator._        object SubscriptionManager {          case class Subscription(id: Int, origin: String,            creationTimestamp: Long) case class ...

Get Akka Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.