diff --git a/akka-docs/rst/general/code/docs/config/ConfigDocSpec.scala b/akka-docs/rst/general/code/docs/config/ConfigDocSpec.scala index 39ef870196..9e8f3b9798 100644 --- a/akka-docs/rst/general/code/docs/config/ConfigDocSpec.scala +++ b/akka-docs/rst/general/code/docs/config/ConfigDocSpec.scala @@ -19,7 +19,7 @@ class ConfigDocSpec extends WordSpec with Matchers { val customConf = ConfigFactory.parseString(""" akka.actor.deployment { /my-service { - router = round-robin + router = round-robin-pool nr-of-instances = 3 } } @@ -31,4 +31,44 @@ class ConfigDocSpec extends WordSpec with Matchers { TestKit.shutdownActorSystem(system) } + + "deployment section" in { + val conf = ConfigFactory.parseString(""" + #//#deployment-section + akka.actor.deployment { + + # '/user/actorA/actorB' is a remote deployed actor + /actorA/actorB { + remote = "akka.tcp://sampleActorSystem@127.0.0.1:2553" + } + + # 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" + } + #//#deployment-section + """) + val system = ActorSystem("MySystem", conf) + TestKit.shutdownActorSystem(system) + } } diff --git a/akka-docs/rst/general/configuration.rst b/akka-docs/rst/general/configuration.rst index cf7bf3fb29..966061e1b3 100644 --- a/akka-docs/rst/general/configuration.rst +++ b/akka-docs/rst/general/configuration.rst @@ -103,6 +103,8 @@ A custom ``application.conf`` might look like this:: stdout-loglevel = "DEBUG" actor { + provider = "akka.cluster.ClusterActorRefProvider" + default-dispatcher { # Throughput for default Dispatcher, set to 1 for as fair as possible throughput = 10 @@ -110,10 +112,8 @@ A custom ``application.conf`` might look like this:: } remote { - server { - # The port clients should connect to. Default is 2552 (AKKA) - port = 2562 - } + # The port clients should connect to. Default is 2552. + netty.tcp.port = 4711 } } @@ -344,6 +344,27 @@ Includes at the top of ``application.conf`` will be overridden by the rest of ``application.conf``, while those at the bottom will override the earlier stuff. +Actor Deployment Configuration +------------------------------ + +Deployment settings for specific actors can be defined in the ``akka.actor.deployment`` +section of the configuration. In the deployment section it is possible to define +things like dispatcher, mailbox, router settings, and remote deployment. +Configuration of these features are described in the chapters detailing corresponding +topics. An example may look like this: + +.. includecode:: code/docs/config/ConfigDocSpec.scala#deployment-section + +The deployment section for a specific actor is identified by the +path of the actor relative to ``/user``. + +You can use asterisks as wildcard matches for the actor path sections, so you could specify: +``/*/sampleActor`` and that would match all ``sampleActor`` on that level in the hierarchy. +You can also use wildcard in the last position to match all actors at a certain level: +``/someParent/*``. Non-wildcard matches always have higher priority to match than wildcards, so: +``/foo/bar`` is considered **more specific** than ``/foo/*`` and only the highest priority match is used. +Please note that it **cannot** be used to partially match section, like this: ``/foo*/bar``, ``/f*o/bar`` etc. + Listing of the Reference Configuration -------------------------------------- diff --git a/akka-docs/rst/project/migration-guide-2.2.x-2.3.x.rst b/akka-docs/rst/project/migration-guide-2.2.x-2.3.x.rst index 1fee3fc72b..a060040343 100644 --- a/akka-docs/rst/project/migration-guide-2.2.x-2.3.x.rst +++ b/akka-docs/rst/project/migration-guide-2.2.x-2.3.x.rst @@ -82,7 +82,7 @@ The old ``cluster.routees-path`` is deprecated, but still working during the dep Example:: /router4 { - router = round-robin + router = round-robin-group nr-of-instances = 10 routees.paths = ["/user/myserviceA", "/user/myserviceB"] cluster.enabled = on diff --git a/akka-remote/src/test/scala/akka/remote/RemoteConsistentHashingRouterSpec.scala b/akka-remote/src/test/scala/akka/remote/RemoteConsistentHashingRouterSpec.scala index f844403951..e1ec1450ac 100644 --- a/akka-remote/src/test/scala/akka/remote/RemoteConsistentHashingRouterSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/RemoteConsistentHashingRouterSpec.scala @@ -27,8 +27,8 @@ class RemoteConsistentHashingRouterSpec extends AkkaSpec(""" val consistentHash1 = ConsistentHash(nodes1, 10) val consistentHash2 = ConsistentHash(nodes2, 10) val keys = List("A", "B", "C", "D", "E", "F", "G") - val result1 = keys collect { case k => consistentHash1.nodeFor(k).routee } - val result2 = keys collect { case k => consistentHash2.nodeFor(k).routee } + val result1 = keys collect { case k ⇒ consistentHash1.nodeFor(k).routee } + val result2 = keys collect { case k ⇒ consistentHash2.nodeFor(k).routee } result1 should be(result2) }