javaakkadistributed-computingdistributedakka-cluster

What do Akka's ActorSystem corresponds to, especially in cluster technology?


sorry if I'll be a little noobish here. I'm studying Java Akka and I'm struggling to grasp the exact meaning of an ActorSystem. I understand it's like an Actor factory, effectively creating the actors I may want to use in my application.

However, I am confused about two things, particularly regarding the Akka cluster usage.


Solution

  • As far as the actors inside the ActorSystem are concerned, actors in a different ActorSystem may as well be in a different JVM (modulo possible classloader conflicts, etc.).

    It's exceptionally rare to need to have multiple ActorSystems in the same JVM: about the only situation where you would strictly need it is a situation like wanting multiple configurations for some functionality in the same JVM (and the functionality being configured isn't flexible about where configuration lives; most/all of Akka's functionality is flexible in this way). Apart from that, multiple ActorSystems in the same JVM is sometimes useful in tests to save the overhead of multiple JVMs.

    So in a cluster, another ActorSystem is definitely listening on a different host:port combination. It's almost certainly running in a different JVM/OS process. It may or may not be running on a different computer.

    An ActorSystem will nearly always correspond 1:1 to a cluster node. It's possible to imagine an implementation that speaks Akka Remoting/Akka Cluster which allows 1 ActorSystem to serve as multiple nodes.