It is possible to get Akka actors running on remote hosts. For more information about Akka, refer to the chapter on parallel programming in Scala. Here, we will only consider how you would use Akka in a networked cluster environment. For example, you can easily refer to actors running on a remote actor system:
val ref = system.actorOf(FooActor.props.withDeploy( Deploy(scope = RemoteScope(address))))
To find a remote actor (one running on a different computer), you have to use the following pattern:
akka.<protocol>://<actorsystemname>@<hostname>:<port>/<actor path> ActorSelection selection = context.actorSelection( "akka.tcp://[email protected]:2552/user/serviceA/worker");
After getting the selection, you can use it as you would do for any other actor: send messages, receive messages, and so on. You need to carry out some basic setup for using remoting. For more information about remoting, refer to the remoting section...