'Change Priority Of individual actors dynamically

I'm attempting my first Akka.Net project.

I have a number of actors (circa 10,000) which are processing projections for an Event Sourcing system. I have modelled the design so that each actor maps to a given projection. This is because multiple messages received for a given projection must be processed serially.

This appears to work fine however I'm looking for a way to select certain actors to receive more system resources so that their work can be prioritised. All the documentation which I've read appears to be focused around prioritisation of messages getting to actors. This doesn't really work for me because each message can only be processed by a single actor. My issue is that 'n' actors might be processing work however I don't want them to have equal access to resources (like CPU etc). I guess it's kind of like I want certain actors to have a higher thread-priority (I might be way off base with my understanding there).

The added complexity is that each actor needs to be able to switch between 'high perf' mode and 'low perf' mode depending on the message it receives.

Is there a way of achieving this?

Thanks for your help.



Solution 1:[1]

Processing can be solved through Routers, you can create a group with a number of actors that process all messages in a mailbox, and if you want to process a group of messages with high priority I recommend you separate those actors to an specific micro service.

To manage priority message you can combine a queue solution like Rabbitmq to priorize messages and read them from the queue.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1