0

I have an actorsystem which has 3 actors and are listed below

  1. RMQreaderActor - This is the actor which reads the messages from the RMQ and tells the below two actors to convert the message and process it
  2. ConverterActor
  3. ProcessorActor

My requirement is to cluster the actorsystem in 4 nodes but I do not want the RMQreaderactor in all the nodes to read the messages from the queue. Only one node should read the message and tell the other actors to process.

Note: If I make RMQreaderactor of all the nodes to read the messages from the queue then it is causing a duplicate read(as I am not issuing the Ack as soon as I read)

Could you please help me out with my requirement

vikram
  • 1

1 Answers1

0

My suggestion is not go that path! Since you desire to have a 4 nodes cluster is better to take advantages of all of them from several reasons:

  • in case that node goes down, you don't have any redundancy, so SPOF
  • if some other actions create pressure in that node, the performance of the system is affected and you have a bottleneck

You can leave all nodes to run RMQreaderActor and since you are using (rabbit mq) Unacked msg will not be picked by some other consumer (other instance of RMQreaderActor from a different node) - unless there is something that I don't get in your consumer.

If those does not convince you, please read (cluster node roles, singletons and proxy actors) http://doc.akka.io/docs/akka/current/scala/cluster-singleton.html - here you see how to have a singleton actor (single instance of an actor in all cluster nodes).