0
votes

I am working with Akka dispatcher/executor configuration and I would like to prove to myself that the configuration changes that I made took effect. So, I want to inspect the dispatcher's executor parameters (i.e. parallelism-min, parallelism-factor, parallelism-max) at runtime.

I tried this:

println(actorSystem.dispatcher.toString)

However, all it prints out is: Dispatcher[akka.actor.default-dispatcher], without any other details of specific parameters.

Is it possible to print out the runtime configuration of my dispatcher?

1

1 Answers

1
votes

you can use:

actorSystem
  .dispatchers
  .lookup("akka.actor.default-dispatcher")
  .configurator
  .config
  .getInt("fork-join-executor.parallelism-max")
actorSystem
  .dispatchers
  .lookup("akka.actor.default-dispatcher")
  .configurator
  .config
  .getInt("fork-join-executor.parallelism-min")
actorSystem
  .dispatchers
  .lookup("akka.actor.default-dispatcher")
  .configurator
  .config
  .getDouble("fork-join-executor.parallelism-factor")