I have an Akka system that is listening remotely with the following configuration:
akka {
log-dead-letters = 0
actor {
provider = "akka.remote.RemoteActorRefProvider"
}
remote {
enabled-transports = ["akka.remote.netty.tcp"]
netty.tcp {
hostname = "127.0.0.1"
port = 5000
}
}
}
redis {
hostname = "localhost"
port = 6379
}
Quite straightforward. Surely, debugging this outputs:
[INFO] [02/17/2015 11:12:56.388] [main] [Remoting] Remoting started; listening on addresses :[akka.tcp://central...@127.0.0.1:5000] Next, I have a Play! application (2.3.6) that should connect to this service. I have the following chunk of code in an action;
Logger.info("Attempting to connect with Push")
val selection = Akka.system().actorSelection("akka.tcp://central...@127.0.0.1:5000")
println(selection)
selection ! "hello"
Again, nothing fancy.
But no matter what I try, from the errors I get on Play!'s side, it seems like the actorSelection is attempting to select an actor from the default play Akka system:
[INFO] [02/17/2015 11:13:19.682] [application-akka.actor.default-dispatcher-2] [akka://application/deadLetters] Message [java.lang.String] from Actor[akka://application/deadLetters] to Actor[akka://application/deadLetters] was not delivered. [2] dead letters encountered. This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' and 'akka.log-dead-letters-during-shutdown'.
Also, on the Play! side, my build.sbt contains akka-remote:
name := "talk-to-remote-app"
version := "1.0"
lazy val `talk-to-remote-app` = (project in file(".")).enablePlugins(PlayScala)
scalaVersion := "2.11.1"
libraryDependencies ++= Seq(
jdbc ,
javaJdbc,
javaEbean,
"mysql" % "mysql-connector-java" % "5.1.27",
anorm ,
cache ,
ws ,
"org.elasticsearch" % "elasticsearch" % "1.3.2",
"com.sksamuel.elastic4s" %% "elastic4s" % "1.3.2",
"com.typesafe.akka" %% "akka-remote" % "2.3.8",
"org.reactivemongo" %% "play2-reactivemongo" % "0.10.5.0.akka23"
)
unmanagedResourceDirectories in Test <+= baseDirectory ( _ /"target/web/public/test" )
Why is this? How can Play! connect to a remote Akka system?