Reputation: 476
I have started working with Akka.NET and was able an application with did self deployment on a remote system with multiple instances (deployment using a round-robin pool router with 5 instances). However, now I want to be able to link multiple servers together. Currently I have this working:
Local Actor --> Remote Actor --> 5 instances
However I am trying to do something like this:
/--->Remote Actor #1 (server1.domain.com) --> 5 instances
Main Actor< --->Remote Actor #2 (server2.domain.com) --> 5 instances
\--->Remote Actor #3 (server3.domain.com) --> 5 instances
When Main Actor
has a message that needs to be processed, it sends it to Remote Actor 1
, 2
, OR 3
in a round-robin fashion. The remote actor who receives the message then sends it to one of the instances, also in a round-robin fashion.
From what I've read, it seems like I need to implement clustering. However, I could not tell from the documentation I found about how to implement it with this kind of nested round-robin processing. It sounded more like a decentralized network where a message from Main Actor
would be passed to Remote Actor 1
, 2
, AND 3
which is definitely not what I would like.
Is there any way with the standard Akka.NET NuGets to implement this or do I need to implement the my own round-robin code in Main Actor
to send a message to each of the Remote Actor
's individual and then let them do their own, standard round-robin.
Any help or suggestion would be greatly appreciated as I am relatively new to using this library. Thank you in advanced.
Upvotes: 0
Views: 262
Reputation: 8414
I think @Mestical's response is what you want, but just to clarify:
Group
round robin router to send messages to the remote actor's on your sub-domains;Pool
round robin router to load-balance work locally between N identical actors.Group
routers use the ActorPath
to message actors created by someone else, whereas Pool
routers create the N identical child actors. The former is generally used for message distribution between ActorSystem
s over Akka.Cluster / Akka.Remote whereas the latter is primarily used to parallelize work.
What Akka.Cluster makes easier in your situation is the possibility for your Group
router to dynamically discover new nodes at run-time (or old nodes removed when they're terminated,) whereas Akka.Remote requires that information to be baked into configuration at startup. Akka.Cluster is just more dynamic, in other words.
Upvotes: 0
Reputation: 56
you don't need to create your own round-robin code. You are almost there, you just need a little tweaking of your code.
Have you gone through this? What you need is to configure the hostnames.
I created this to better explain this to you
Main Actor/Router
you can remotely deploy routers
Please let me know if this is not clear to you!
Upvotes: 1