From b6fe70a3f2dd9e456b5744dc01ceeec240157db3 Mon Sep 17 00:00:00 2001 From: Jan van Mansum Date: Sun, 18 Oct 2015 17:28:54 +0200 Subject: [PATCH 1/2] Upgraded to scala 2.11.7 and akka 2.4.0 --- .gitignore | 9 ++------- HelloLocal/build.sbt | 6 +++--- HelloLocal/src/main/resources/application.conf | 8 +++----- HelloLocal/src/main/scala/local/Local.scala | 3 ++- HelloRemote/build.sbt | 6 +++--- .../src/main/resources/application.conf | 18 ++++++++---------- 6 files changed, 21 insertions(+), 29 deletions(-) diff --git a/.gitignore b/.gitignore index 8569f8f..209b057 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,3 @@ -bin/ -project/ +.idea/ +/*.iml target/ -.cache -.classpath -.project -.settings -*.class 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..5e9a88d 100644 --- a/HelloLocal/src/main/scala/local/Local.scala +++ b/HelloLocal/src/main/scala/local/Local.scala @@ -13,7 +13,8 @@ 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") + val remote2 = context.actorOf 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 + } + } } From ecb8fa7ee03100f363fc97c732c8f0ac93fa97c2 Mon Sep 17 00:00:00 2001 From: Jan van Mansum Date: Sun, 18 Oct 2015 17:35:36 +0200 Subject: [PATCH 2/2] Removed error --- .gitignore | 7 +++++++ HelloLocal/src/main/scala/local/Local.scala | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 209b057..2fab5f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,10 @@ .idea/ /*.iml +bin/ +project/ target/ +.cache +.classpath +.project +.settings +*.class diff --git a/HelloLocal/src/main/scala/local/Local.scala b/HelloLocal/src/main/scala/local/Local.scala index 5e9a88d..39bcab0 100644 --- a/HelloLocal/src/main/scala/local/Local.scala +++ b/HelloLocal/src/main/scala/local/Local.scala @@ -14,7 +14,6 @@ class LocalActor extends Actor { // create the remote actor val remote = context.actorSelection("akka.tcp://HelloRemoteSystem@127.0.0.1:2553/user/RemoteActor") - val remote2 = context.actorOf var counter = 0 def receive = {