| career | drupal | java | mac | mysql | perl | scala | uml | unix  

Akka/Scala example source code file (ConfigDocSpec.scala)

This example Akka source code file (ConfigDocSpec.scala) is included in my "Source Code Warehouse" project. The intent of this project is to help you more easily find Akka and Scala source code examples by using tags.

All credit for the original source code belongs to; I'm just trying to make examples easier to find. (For my Scala work, see my Scala examples and tutorials.)

Akka tags/keywords

actor, actorsystem, akka, configdocspec, matchers, mysystem, test, testing, testkit, wordspec

The ConfigDocSpec.scala Akka example source code

 * Copyright (C) 2009-2014 Typesafe Inc. <>
package docs.config

import org.scalatest.WordSpec
import org.scalatest.Matchers
import akka.testkit.TestKit

import com.typesafe.config.ConfigFactory

class ConfigDocSpec extends WordSpec with Matchers {

  "programmatically configure ActorSystem" in {
    val customConf = ConfigFactory.parseString(""" {
        /my-service {
          router = round-robin-pool
          nr-of-instances = 3
    // ConfigFactory.load sandwiches customConfig between default reference
    // config and default overrides, and then resolves it.
    val system = ActorSystem("MySystem", ConfigFactory.load(customConf))


  "deployment section" in {
    val conf = ConfigFactory.parseString("""
  #//#deployment-section {
    # '/user/actorA/actorB' is a remote deployed actor
    /actorA/actorB {
      remote = "akka.tcp://sampleActorSystem@"
    # all direct children of '/user/actorC' have a dedicated dispatcher 
    "/actorC/*" {
      dispatcher = my-dispatcher
    # '/user/actorD/actorE' has a special priority mailbox
    /actorD/actorE {
      mailbox = prio-mailbox
    # '/user/actorF/actorG/actorH' is a random pool
    /actorF/actorG/actorH {
      router = random-pool
      nr-of-instances = 5
  my-dispatcher {
    fork-join-executor.parallelism-min = 10
    fork-join-executor.parallelism-max = 10
  prio-mailbox {
    mailbox-type = "a.b.MyPrioMailbox"
    val system = ActorSystem("MySystem", conf)

Other Akka source code examples

Here is a short list of links related to this Akka ConfigDocSpec.scala source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller


new blog posts


Copyright 1998-2021 Alvin Alexander,
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.