Here it is:
https://github.com/jboner/akka/tree/wip-2.0
IMPORTANT: all code that is pushed into either 'master' or the upcoming 1.2 branch must be cherry-picked and pushed into this 'wip-2.0' branch.
After lots of work and painful merge I have now committed the branch that will be Akka 2.0. This merges in the clustering stuff from the Cloudy Akka commercial offering. But is changing clustering and remoting from an API to a configuration/deployment task.
The general idea is to add a virtual "address" when creating the Actor like this:
val actorRef = actorOf[MyActor]("service-pi")
And then from the outside configure it how it should be deployed using a deployment config as below. Then it is write the code once, not thinking about remoting or clustering and then as a deployment step configure it to run in a specific way.
Most of the mechanics is there. Clustering, cluster-wide deployment, basic routing etc.
akka {
actor {
deployment {
service-pi { # stateless actor with replication factor 3 and round-robin load-balancer
router = "round-robin" # routing (load-balance) scheme to use
# available: "direct", "round-robin", "random", "least-cpu", "least-ram", "least-messages"
# or: fully qualified class name of the router class
# default is "direct";
format = "akka.serializer.Format$Default$"
clustered { # makes the actor available in the cluster registry
# default (if omitted) is local non-clustered actor
home = "node:test-1" # defines the hostname, IP-address or node name of the "home" node for clustered actor
# available: "host:<hostname>", "ip:<ip address>" and "node:<node name>"
# default is "host:localhost"
replicas = 3 # number of actor replicas in the cluster
# available: integer above 0 (1-N) or the string "auto" for auto-scaling
# if "auto" is used then 'home' has no meaning
# default is '1';
stateless = on # is the actor stateless or stateful
# if turned 'on': actor is defined as stateless and can be load-balanced accordingly
# if turned 'off' (or omitted): actor is defined as stateful which means replicatable through transaction log
# default is 'off'
}
}
}
}
Some remote test have been commented out. Since the remoting API will be completely removed some are not valid any longer. The cluster tests have also been commented out since the explicit API will not be exposed later. We have to help out all of us to write good tests for the new clustering.
There is still a lot of work to do (months) but I think we are on the right track.
--
Jonas Bonér
CTO
Typesafe - Enterprise-Grade Scala from the Experts
Phone: +46 733 777 123
Twitter: @jboner