2.2 Spotlight: Running Actor Apps with akka.Main
One high-level pattern we have recommended often in the past is to minimize the number of top-level actors, which in its logical consequence means to have only exactly one of these. This one top-level actor represents the whole application life-cycle: its constructor is equivalent to a traditional main class in Java and its supervisorStrategy determines which components of the application can be restarted and which failures are fatal.
2.2 Spotlight: Adaptive Load Balancing Based on Cluster Metrics
The member nodes of the cluster collects system health metrics, such as heap memory and CPU usage. The metrics are spread to other nodes and consumed by a new type of router that performs load balancing of messages to cluster nodes based on the cluster metrics data.
2.2 Spotlight: Graceful Removal of Cluster Member
You can just stop the actor system (or the JVM process). It will be detected as unreachable and removed after the automatic or manual downing, but there is a nicer alternative.
2.2 Spotlight: Startup when Cluster Size Reached
With a configuration option you can define required number of members of a certain role before the leader changes status of ‘Joining’ members to 'Up’.
2.2 Spotlight: Cluster Client
An actor system that is not part of the cluster can communicate with actors somewhere in the cluster via the ClusterClient.
2.2 Spotlight: Publish/Subscribe in Cluster
With the distributed pub/sub extension you can broadcast messages to all actors in the cluster that have registered interest in a named topic.
2.2 Spotlight: Remote Death Watch
Watch works as expected independent of where the watched actor is located. You will receive a Terminated message, no matter the reason for the termination.
2.2 Spotlight: ActorSelection, Watch and Identify
ActorSelection can be used pretty much in the same way as an ActorRef, but DeathWatch must always be done through an ActorRef, because here the incarnation of the actor is important.
2.2 Spotlight: actorSelection instead of actorFor
actorFor is deprecated in favor of actorSelection because actor references acquired with actorFor behave differently for local and remote actors.
2.2 Spotlight: Getting Started with Typesafe Activator
Typesafe Activator helps you get started with the Typesafe Platform, Play Framework, Akka & Scala.
You will find 5 getting started tutorials for Akka 2.2 in Typesafe Activator:
- Hello Akka!
- Akka Supervision
- Akka Java Spring
- Akka Clustered PubSub with Scala!
- Distributed workers with Akka and Scala!
Try it out! (Typesafe Activator is in Developer Preview)