1
votes

I have a question about the Akka 2.4 TCP API.

I running a server and have 2 TCP servers in Akka TCP, one for incoming clients and one for my server's worker nodes (which are on other computers/IPs). I have one current connection to a client, and one connection to a worker node.

If receiving a message from a client, I want to pass some of that information to the worker node, but my TCP Akka Actor representing the worker node connection doesn't seem to like when I, from the thread running the Client Akka Actor, send messages to the Akka Actor worker node.

So, as an example, if the client sends a message to delete a file, and that partitions on that file is on a worker node, I want to send a TCP message to that worker node that it should delete the partitions.

How can I from the client Actor send a message to the worker node Actor, that it should pass to the worker node server through TCP? When just doing the regular workerActorRef ! msg it doesn't receive it at all and no logging is shown.

I hope this question wasn't unclear but essentially I want the workerActorRef to in some way be able to have some functionality similar to "send this through the TCP socket".

Cheers,

Johan

1
Have you looked at Akka Remoting at all: doc.akka.io/docs/akka/2.3.6/scala/remoting.html. If used properly it should be able to achieve what you want. You might want to look into Clustering too as it's built on top of Remoting: doc.akka.io/docs/akka/2.3.6/scala/cluster-usage.htmlcmbaxter
@cmbaxter If you write that as an answer I'll accept it. ThanksJohan S

1 Answers

3
votes

Have you looked at Akka Remoting at all? If used properly it should be able to achieve what you want. You might want to look into Clustering too as it's built on top of Remoting.