I have a use case which is million clients data processed by individual actor.And all the actors created on across multiple nodes and formed as a cluster.
When i receive a message i have to send it to the particular actor in the cluster which is responsible for.How can i map to that actor with AKKA cluster.I don't want it to send to other actors.
Can this use case achievable With Akka - Cluster?
How failure handling will happen here?
I cant understand what cluster singleton is,saying in doc that it will only created on oldest node. In my case i only want all million actors as singleton.
How particular actor in cluster mapped with message?
How can i create actors like this in cluster?
Asked
Active
Viewed 205 times
0

Arun
- 67
- 11
1 Answers
2
Assuming that each actor is responsible for some uniquely identifiable part of state, it sounds like you want to use cluster sharding to balance the actors across the cluster, and route messages by ID.
Note that since the overhead of an actor is fairly small, it's not implausible to host millions of actors on a single node.

Levi Ramsey
- 18,884
- 1
- 16
- 30
-
every actor is responsible for a task or client so when high no of messages processing then the memory will be bottle neck that why i wanna use cluster to spilt the 1m actors actors different machines – Arun May 02 '22 at 07:38
-
Can we create actor from outside of the cluster ?and send messages to the cluster from outside the cluster? – Arun May 03 '22 at 15:11
-
It's generally not a great idea to have code outside the service interacting directly with the cluster via remoting. The general recommendation is to use HTTP or gRPC etc. for communicating from outside the cluster; the handler for the HTTP/gRPC/whatever endpoint can then spawn/discover/send messages to actors based on the incoming requests. This also has the advantage of not requiring the components outside of the cluster to also be written in Akka. – Levi Ramsey May 03 '22 at 15:32
-
I have to create actors dynamically.So that must be outside of the cluster.Or any mechanism will create actor when receiving certain type of message – Arun May 03 '22 at 16:19