=doc #3620 Add unified documentation of deployment section
This commit is contained in:
parent
eb8a3b2c3e
commit
fa215ff965
4 changed files with 69 additions and 8 deletions
|
|
@ -19,7 +19,7 @@ class ConfigDocSpec extends WordSpec with Matchers {
|
||||||
val customConf = ConfigFactory.parseString("""
|
val customConf = ConfigFactory.parseString("""
|
||||||
akka.actor.deployment {
|
akka.actor.deployment {
|
||||||
/my-service {
|
/my-service {
|
||||||
router = round-robin
|
router = round-robin-pool
|
||||||
nr-of-instances = 3
|
nr-of-instances = 3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -31,4 +31,44 @@ class ConfigDocSpec extends WordSpec with Matchers {
|
||||||
|
|
||||||
TestKit.shutdownActorSystem(system)
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,8 @@ A custom ``application.conf`` might look like this::
|
||||||
stdout-loglevel = "DEBUG"
|
stdout-loglevel = "DEBUG"
|
||||||
|
|
||||||
actor {
|
actor {
|
||||||
|
provider = "akka.cluster.ClusterActorRefProvider"
|
||||||
|
|
||||||
default-dispatcher {
|
default-dispatcher {
|
||||||
# Throughput for default Dispatcher, set to 1 for as fair as possible
|
# Throughput for default Dispatcher, set to 1 for as fair as possible
|
||||||
throughput = 10
|
throughput = 10
|
||||||
|
|
@ -110,10 +112,8 @@ A custom ``application.conf`` might look like this::
|
||||||
}
|
}
|
||||||
|
|
||||||
remote {
|
remote {
|
||||||
server {
|
# The port clients should connect to. Default is 2552.
|
||||||
# The port clients should connect to. Default is 2552 (AKKA)
|
netty.tcp.port = 4711
|
||||||
port = 2562
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -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
|
the rest of ``application.conf``, while those at the bottom will
|
||||||
override the earlier stuff.
|
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
|
Listing of the Reference Configuration
|
||||||
--------------------------------------
|
--------------------------------------
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ The old ``cluster.routees-path`` is deprecated, but still working during the dep
|
||||||
Example::
|
Example::
|
||||||
|
|
||||||
/router4 {
|
/router4 {
|
||||||
router = round-robin
|
router = round-robin-group
|
||||||
nr-of-instances = 10
|
nr-of-instances = 10
|
||||||
routees.paths = ["/user/myserviceA", "/user/myserviceB"]
|
routees.paths = ["/user/myserviceA", "/user/myserviceB"]
|
||||||
cluster.enabled = on
|
cluster.enabled = on
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,8 @@ class RemoteConsistentHashingRouterSpec extends AkkaSpec("""
|
||||||
val consistentHash1 = ConsistentHash(nodes1, 10)
|
val consistentHash1 = ConsistentHash(nodes1, 10)
|
||||||
val consistentHash2 = ConsistentHash(nodes2, 10)
|
val consistentHash2 = ConsistentHash(nodes2, 10)
|
||||||
val keys = List("A", "B", "C", "D", "E", "F", "G")
|
val keys = List("A", "B", "C", "D", "E", "F", "G")
|
||||||
val result1 = keys collect { case k => consistentHash1.nodeFor(k).routee }
|
val result1 = keys collect { case k ⇒ consistentHash1.nodeFor(k).routee }
|
||||||
val result2 = keys collect { case k => consistentHash2.nodeFor(k).routee }
|
val result2 = keys collect { case k ⇒ consistentHash2.nodeFor(k).routee }
|
||||||
result1 should be(result2)
|
result1 should be(result2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue