Skip to content

Instantly share code, notes, and snippets.

@patriknw
Created July 5, 2013 07:03
Show Gist options
  • Save patriknw/5932539 to your computer and use it in GitHub Desktop.
Save patriknw/5932539 to your computer and use it in GitHub Desktop.
ClusterClient spotlight
// on the client
val initialContacts = Set(
system.actorSelection("akka.tcp://Other@host1:2552/user/receptionist"),
system.actorSelection("akka.tcp://Other@host2:2552/user/receptionist"))
val c = system.actorOf(ClusterClient.props(initialContacts))
c ! ClusterClient.Send("/user/serviceA", "hello", localAffinity = true)
// on the server nodes
val serviceA = system.actorOf(Props[Service], "serviceA")
ClusterReceptionistExtension(system).registerService(serviceA)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment