-
-
Save gaocegege/de13b9b80bb9b36a6a83 to your computer and use it in GitHub Desktop.
akka remote
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// client conf | |
akka { | |
loglevel = "DEBUG" | |
actor { | |
provider = "akka.remote.RemoteActorRefProvider" | |
} | |
remote { | |
transport = "akka.remote.netty.NettyRemoteTransport" | |
log-sent-messages = on | |
log-received-messages = on | |
netty { | |
hostname = "10.224.36.55" | |
port = 2552 | |
} | |
} | |
} | |
// client code | |
object Client extends App { | |
val system = ActorSystem("system") | |
val master = system.actorSelection("akka://[email protected]:2552/user/master") | |
val slave = system.actorOf(Props[Slave], "slave") | |
master.tell(Pong, slave) | |
system.awaitTermination() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// server conf | |
akka { | |
loglevel = "DEBUG" | |
actor { | |
provider = "akka.remote.RemoteActorRefProvider" | |
} | |
remote { | |
transport = "akka.remote.netty.NettyRemoteTransport" | |
log-sent-messages = on | |
log-received-messages = on | |
netty { | |
hostname = "10.224.19.240" | |
port = 2552 | |
} | |
} | |
} | |
// server code | |
object Server extends App { | |
val system = ActorSystem("system") | |
val master = system.actorOf(Props[Master], "master") | |
system.awaitTermination(10 seconds) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment