I'm writing distributed BBS software using Akka 2.2.3 as remote message passing in Scala.
Then, I've found some problem in networking over the Internet through NAT: Akka doesn't recognize external IP address, AFAIK because it uses socket.bind
.
Next, I thought that I can specify 0.0.0.0 as akka.remote.netty.tcp.hostname
in order to adopt all interfaces and addresses to listen connections from the Internet side.
Here is the problem -- Akka uses 0.0.0.0 as its own IP address, and generates ActorRef
like this: akka.tcp://[email protected]/user/foo
.
Other nodes cannot refer the node using this ActorRef
over the Internet.
What should I do for connecting nodes over the Internet? Can't I use Akka over NAT?
Akka has two ways of using remoting: Lookup : used to look up an actor on a remote node with actorSelection(path) Creation : used to create an actor on a remote node with actorOf(Props(...), actorName)
Akka Cluster provides a fault-tolerant decentralized peer-to-peer based Cluster Membership Service with no single point of failure or single point of bottleneck. It does this using gossip protocols and an automatic failure detector.
Akka remoting does not support NAT, which is intentional since its purpose is just to enable clustering (i. e. symmetrical communication between a tightly controlled set of nodes). There are several protocols that have been devised for Internet-wide use, e. g. HTTP/REST (see Spray which is becoming Akka HTTP) or bare TCP using Akka IO.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With