Hi I'm looking at the Cluster Singleton Pattern (using 2.3.0-RC1) and running into some trouble:
node A is started first (and hence the active singleton?) node B is started second on node A I run a client that connects to node B which contacts the singleton through a proxy as per the documentation example (http://doc.akka.io/docs/akka/2.3.0-RC1/contrib/cluster-singleton.html). I can see in my logs that the ActorSelection contains the valid Anchor & Path for node A. The singleton (on node A) creates an actor on the sender (node B): val remoteAddress = sender.path.address val actor = context.actorOf(Props(new PlayerHub(pid)).withDeploy(Deploy(scope = RemoteScope(remoteAddress))), "playerHub-" + pid) the first problem I run into is a* java.io.NotSerializableException: * *ClusterAwareSuperPlayerHub* thrown on node A, which I tried resolving by marking it as Serializable just to see what would happen. I am wondering though why the singleton is being serialized though? In my case it could be large and contains a significant amount of state, not something I want to be sent around under the covers. Once I've marked it as serializable, I encountered on node B: *java.io.InvalidClassException: ClusterAwareSuperPlayerHub; no valid constructor *which I assume is because it does not have a default constructor? It only has one constructor taking some service dependencies, I provided this implicitly through the props that was given to ClusterSingletonManager.props(), obviously not being used here. Why is node A sending node B a serialized copy of the singleton? My understanding is that only the ClusterSingletonManager would create an instance of the singleton if needed (remote oldest node drops off etc) by using the supplied props. As an aside, looking at the cluster sharding pattern next, would be nice to get rid of the "SuperPlayerHub" and manually maintaining that location state of the PlayerHub actors (one per player cluster wide). Thank you Peter -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: http://akka.io/faq/ >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/groups/opt_out.
