How to configure dispatcher correctly in asp.net core akka

589 Views Asked by At

I am adding a pinned dispatcher to my akka.net configuration as I read this will give a timely manner to my dispatch messages to my actor but as I followed akka configuration I came up with this

 using (_actorSystem = ActorSystem.Create("SchedulerAutoAction"))
            {
                var props = Props.Create<TaskSchedulerAktor>().WithDispatcher("pinned-dispatcher"); // handle the mailbox timely
                _actorRef = _actorSystem.ActorOf(props, "TaskSchedulerAutoActionActor");
            }

as I want to run this based on pinned dispatcher but currently I got this error in my terminal

Unhandled Exception: Akka.Configuration.ConfigurationException: Dispatcher [pinned-dispatcher] not configured for path akka://SchedulerAutoAction/user/TaskSchedulerAutoActionActor
   at Akka.Actor.LocalActorRefProvider.ActorOf(ActorSystemImpl system, Props props, IInternalActorRef supervisor, ActorPath path, Boolean systemService, Deploy deploy, Boolean lookupDeploy, Boolean async)

does anyone use dispatcher and configure it correctly? Can you suggest any improvement to my code? Please let me know

1

There are 1 best solutions below

0
On

The string argument that you're passing as dispatcher's identifier, is in fact a HOCON path in your actor system configuration: for PinnedDispatcher the path could be i.e. akka.io.pinned-dispatcher.

PS: Keep in mind, that you can create your own pinned settings - details are in the documentation I've linked above.