Created
October 6, 2015 10:55
-
-
Save rogeralsing/12dbe4745f5837f90940 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import akka.actor._ | |
import com.typesafe.config.ConfigFactory | |
object Program { | |
def main(args:Array[String]): Unit ={ | |
val conf = ConfigFactory.load(ConfigFactory.parseString(""" | |
akka{ | |
stdout-loglevel = WARN | |
loglevel = WARN | |
log-config-on-start = off | |
} | |
akka.actor { | |
provider = "akka.cluster.ClusterActorRefProvider" | |
} | |
akka.remote { | |
log-remote-lifecycle-events = off | |
netty.tcp { | |
hostname = "127.0.0.1" | |
port = 8090 | |
} | |
} | |
akka.cluster { | |
seed-nodes = [ | |
"akka.tcp://[email protected]:2551" | |
"akka.tcp://[email protected]:2552" | |
] | |
auto-down = on | |
} | |
akka.log-dead-letters=1000 | |
""")) | |
val system = ActorSystem.create("ClusterSystem",conf) | |
val dummy = system.actorOf(Props[DummyActor],"dummy") | |
println("starting node...") | |
val res = scala.io.StdIn.readLine() | |
println(res) | |
} | |
} | |
class DummyActor extends Actor { | |
def receive = { | |
case str:String => println("Msg from " + sender().toString()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment