Hello,
I had a working demo of Akka remoting working in a Docker container. I ran
my server in Docker and was able to communicate with it from an external
program. My application.conf looked like this:
akka {
loglevel = "ERROR"
stdout-loglevel = "ERROR"
loggers = ["akka.event.slf4j.Slf4jLogger"]
actor {
provider = akka.remote.RemoteActorRefProvider
}
remote {
enabled-transports = ["akka.remote.netty.tcp"]
netty.tcp {
# Internal addr
bind-hostname = localhost # also tried 127.0.0.1
bind-port = 2551
# External Docker addr
hostname = "172.16.240.141"
port = 9100
}
}
}
Boxed up I run my container like this (to map ports)--the web port mapping
works fine:
docker run -it -p 9100:2551 -p 9101:8080 --name dexp localhost:5000/root
My client tries to connect to it like this:
val c = ConfigFactory parseString """akka {
actor {
provider = "akka.remote.RemoteActorRefProvider"
}
remote {
enabled-transports = ["akka.remote.netty.tcp"]
netty.tcp {
hostname = "localhost"
port = 5151
}
}
}"""
val sys = ActorSystem( "boom", c )
val actor = sys.actorSelection(
"akka.tcp://[email protected]:9100/user/dockerexp")
println("Actor: "+actor)
implicit val timo = Timeout(5.seconds)
try {
println( Await.result( (actor ? "hey").asInstanceOf[Future[String]], 15.
seconds) )
} finally {
println("Dying...")
Thread.sleep(5000)
sys.shutdown()
}
This isn't working anymore--just times out and dies. It did work several
months ago when 2.4-SNAPSHOT was first available. Am I doing something
wrong?
Thanks,
Greg
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.