5. Akka Actor Model w/
Remoting
Actor
BehaviorMailbox
Parent
Child
Child
M M MActor
BehaviorMailbox
Messages
- Configuration
- Thread pools
Actor System
Lookup via ActorSelection
Remote creation via deployment configuration
- Configuration
- Thread pools
Actor System
6. Actor System Configuration
for Remoting
akka {
actor {
provider = "akka.remote.RemoteActorRefProvider"
}
remote {
enabled-transports = ["akka.remote.netty.tcp"]
netty.tcp {
hostname = "127.0.0.1"
port = 2552
}
}
}
14. Messaging Patterns
• More patterns:
• Sender retries on timeout or failure
• A -> B, B -> C, C responds to A directly
• Routers
• Suggestions for more patterns welcome!
15. Summary:
Remote Actors or HTTP?
• Remote actors:
• Symmetric; uniform for local/remote
• Rich interaction patterns, very simple protocol
• Problems with NAT and load balancers
• HTTP:
• Asymmetric; remote-only
• Simple interaction patterns, complex protocol
• Ubiquitous
• Originally designed for a very different purpose
16. For More Information
• Sample code: https://github.com/polymorphic/akka-
messaging-patterns.git
• Akka remoting: http://doc.akka.io/docs/akka/2.3.9/
scala/remoting.html
• JLine http://jline.sourceforge.net
• PersistJson https://github.com/nestorpersist/json
• Effective Akka, Patterns and Best Practices by Jamie
Allen