8. Location transparency with
RemoteActorRef
● Write code that looks like it's communicating with
local actors
● But with just a few configuration settings your
actors can begin communicating with actors
hosted in remote processes in a way that's fully
location transparent to your code.
● RemoteActorRef:
Internal Api that is used when referencing the
Actor on a different node than its "home" node.
9. Remote addressing
● Address
- Protocol
- System
- Host
- Port
● ActorPath:
Actor path is a unique path to an actor that shows
the creation path up through the actor tree to the
root actor
15. Akka remoting features
● Distributed by Default
● Ways in which Transparency is Broken
● How is Remoting Used?
● Peer-to-Peer vs. Client-Server
● Marking Points for Scaling Up with Routers
16. Distributed by Default
● Everything in Akka is designed to work in a
distributed setting
● All interactions of actors use purely message
passing and everything is asynchronous.
● Remote to local instead of trying to go from
local to remote (A Note on Distributed
Computing- Jim Waldo, Geoff Wyant,
November 1994)
17. Ways in which Transparency is
Broken
● All messages sent over the wire must be
serializable
● Everything needs to be aware of all interactions
being fully asynchronous
● Probability for a message to be lost is much
higher than within one JVM
● On single JVM it is closed to 0 but not 0
18. How is Remoting Used?
● Purely driven by configuration
● Application can be scaled out without having to
touch the code.
● Only piece of the API which allows
programmatic influence on remote deployment
is Props contain a field which may be set to a
specific Deploy instance
20. Peer-to-Peer vs. Client-Server
● If a system A can connect to a system B then
system B must also be able to connect to
system A.
● There is no system that only accepts
connections, and there is no system that only
initiates connections.
23. Challenges Remoting solves
● How to address actor systems living on remote hosts.
● How to address individual actors on remote actor
systems.
● How to turn messages to bytes on the wire.
(Serialization)
● How to manage low-level, network connections (and
reconnections) between hosts, detect crashed actor
systems and hosts, all transparently.
32. Types of Remote Interaction
● Akka has two ways of using remoting:
● Lookup :
Used to look up an actor on a remote node with
actorSelection(path)
● Creation :
Used to create an actor on a remote node with
actorOf(Props(...), actorName)