Search code examples
akkaakka-stream

Defining dedicated dispatcher in Akka Stream


Just wondering where a dispacther should be defined in application.conf.

I red contradictory things online and the official akka documentation does not specify it.

Where should a custom dispatcher be defined in application.conf?

In the root of the file ?

In akka{} ?

In akka.actor {} ?

I am not really sure, of the proper way ?

Also if it is in the root of the file, how does akka, know how to detect that a dispatcher is being defined ?

Not that my application is a pure akka-stream application, and i do not not create actor explicitly, but rather let akka-stream do it. I need some dedicated dispatcher for some specific stage of my stream.


Solution

  • define your dispatcher in the root of the file. there are several ways to define, which actor use which dispatcher. this page will show you how to define a custom dispatcher and how to use them as a system "global" dispatcher and for specified actors with a config or while spawn actors.