diff --git a/.gitignore b/.gitignore index 8569f8f..2fab5f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +.idea/ +/*.iml bin/ project/ target/ diff --git a/HelloLocal/build.sbt b/HelloLocal/build.sbt index bca5351..aa6292c 100644 --- a/HelloLocal/build.sbt +++ b/HelloLocal/build.sbt @@ -2,12 +2,12 @@ name := "HelloLocal" version := "1.0" -scalaVersion := "2.10.1" +scalaVersion := "2.11.7" resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/" libraryDependencies ++= Seq( - "com.typesafe.akka" %% "akka-actor" % "2.1.1", - "com.typesafe.akka" %% "akka-remote" % "2.1.1" + "com.typesafe.akka" %% "akka-actor" % "2.4.0", + "com.typesafe.akka" %% "akka-remote" % "2.4.0" ) diff --git a/HelloLocal/src/main/resources/application.conf b/HelloLocal/src/main/resources/application.conf index b1e4994..a1d7115 100644 --- a/HelloLocal/src/main/resources/application.conf +++ b/HelloLocal/src/main/resources/application.conf @@ -4,12 +4,10 @@ akka { provider = "akka.remote.RemoteActorRefProvider" } remote { - transport = "akka.remote.netty.NettyRemoteTransport" - //log-sent-messages = on - //log-received-messages = on - netty { + enabled-transports = ["akka.remote.netty.tcp"] + netty.tcp { hostname = "127.0.0.1" - port = 0 + port = 2552 } } } diff --git a/HelloLocal/src/main/scala/local/Local.scala b/HelloLocal/src/main/scala/local/Local.scala index 2394ca4..39bcab0 100644 --- a/HelloLocal/src/main/scala/local/Local.scala +++ b/HelloLocal/src/main/scala/local/Local.scala @@ -13,7 +13,7 @@ object Local extends App { class LocalActor extends Actor { // create the remote actor - val remote = context.actorFor("akka://HelloRemoteSystem@127.0.0.1:5150/user/RemoteActor") + val remote = context.actorSelection("akka.tcp://HelloRemoteSystem@127.0.0.1:2553/user/RemoteActor") var counter = 0 def receive = { diff --git a/HelloRemote/build.sbt b/HelloRemote/build.sbt index 5a06858..16cb05f 100644 --- a/HelloRemote/build.sbt +++ b/HelloRemote/build.sbt @@ -2,12 +2,12 @@ name := "HelloRemote" version := "1.0" -scalaVersion := "2.10.1" +scalaVersion := "2.11.7" resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/" libraryDependencies ++= Seq( - "com.typesafe.akka" %% "akka-actor" % "2.1.1", - "com.typesafe.akka" %% "akka-remote" % "2.1.1" + "com.typesafe.akka" %% "akka-actor" % "2.4.0", + "com.typesafe.akka" %% "akka-remote" % "2.4.0" ) diff --git a/HelloRemote/src/main/resources/application.conf b/HelloRemote/src/main/resources/application.conf index 0021aed..7e60d40 100644 --- a/HelloRemote/src/main/resources/application.conf +++ b/HelloRemote/src/main/resources/application.conf @@ -2,15 +2,13 @@ akka { //loglevel = "DEBUG" actor { provider = "akka.remote.RemoteActorRefProvider" - } - remote { - transport = "akka.remote.netty.NettyRemoteTransport" - //log-sent-messages = on - //log-received-messages = on - netty { - hostname = "127.0.0.1" - port = 5150 - } - } + } + remote { + enabled-transports = ["akka.remote.netty.tcp"] + netty.tcp { + hostname = "127.0.0.1" + port = 2553 + } + } }