Merge pull request #2004 from akka/wip-3868-doc-remote-router-group-patriknw
=doc #3868 Clarify remote router group
This commit is contained in:
commit
57d831716a
5 changed files with 52 additions and 32 deletions
|
|
@ -254,24 +254,21 @@ Routers with Remote Destinations
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
It is absolutely feasible to combine remoting with :ref:`routing-java`.
|
It is absolutely feasible to combine remoting with :ref:`routing-java`.
|
||||||
This is also done via configuration::
|
|
||||||
|
|
||||||
akka {
|
A pool of remote deployed routees can be configured as:
|
||||||
actor {
|
|
||||||
deployment {
|
|
||||||
/serviceA/aggregation {
|
|
||||||
router = "round-robin-pool"
|
|
||||||
nr-of-instances = 10
|
|
||||||
target {
|
|
||||||
nodes = ["akka.tcp://app@10.0.0.2:2552", "akka://app@10.0.0.3:2552"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
This configuration setting will clone the actor “aggregation” 10 times and deploy it evenly distributed across
|
.. includecode:: ../scala/code/docs/routing/RouterDocSpec.scala#config-remote-round-robin-pool
|
||||||
the two given target nodes.
|
|
||||||
|
This configuration setting will clone the actor defined in the ``Props`` of the ``remotePool`` 10
|
||||||
|
times and deploy it evenly distributed across the two given target nodes.
|
||||||
|
|
||||||
|
A group of remote actors can be configured as:
|
||||||
|
|
||||||
|
.. includecode:: ../scala/code/docs/routing/RouterDocSpec.scala#config-remote-round-robin-group
|
||||||
|
|
||||||
|
This configuration setting will send messages to the defined remote actor paths.
|
||||||
|
It requires that you create the destination actors on the remote nodes with matching paths.
|
||||||
|
That is not done by the router.
|
||||||
|
|
||||||
.. _remote-sample-java:
|
.. _remote-sample-java:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -187,6 +187,8 @@ The routee actors are created externally from the router:
|
||||||
The paths may contain protocol and address information for actors running on remote hosts.
|
The paths may contain protocol and address information for actors running on remote hosts.
|
||||||
Remoting requires the ``akka-remote`` module to be included in the classpath.
|
Remoting requires the ``akka-remote`` module to be included in the classpath.
|
||||||
|
|
||||||
|
.. includecode:: ../scala/code/docs/routing/RouterDocSpec.scala#config-remote-round-robin-group
|
||||||
|
|
||||||
Router usage
|
Router usage
|
||||||
^^^^^^^^^^^^
|
^^^^^^^^^^^^
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -149,6 +149,28 @@ akka.actor.deployment {
|
||||||
}
|
}
|
||||||
#//#config-consistent-hashing-group
|
#//#config-consistent-hashing-group
|
||||||
|
|
||||||
|
#//#config-remote-round-robin-pool
|
||||||
|
akka.actor.deployment {
|
||||||
|
/parent/remotePool {
|
||||||
|
router = round-robin-pool
|
||||||
|
nr-of-instances = 10
|
||||||
|
target.nodes = ["akka.tcp://app@10.0.0.2:2552", "akka://app@10.0.0.3:2552"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#//#config-remote-round-robin-pool
|
||||||
|
|
||||||
|
#//#config-remote-round-robin-group
|
||||||
|
akka.actor.deployment {
|
||||||
|
/parent/remoteGroup {
|
||||||
|
router = round-robin-group
|
||||||
|
routees.paths = [
|
||||||
|
"akka.tcp://app@10.0.0.1:2552/user/workers/w1",
|
||||||
|
"akka.tcp://app@10.0.0.2:2552/user/workers/w1",
|
||||||
|
"akka.tcp://app@10.0.0.3:2552/user/workers/w1"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#//#config-remote-round-robin-group
|
||||||
|
|
||||||
#//#config-resize-pool
|
#//#config-resize-pool
|
||||||
akka.actor.deployment {
|
akka.actor.deployment {
|
||||||
/parent/router25 {
|
/parent/router25 {
|
||||||
|
|
|
||||||
|
|
@ -261,24 +261,21 @@ Routers with Remote Destinations
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
It is absolutely feasible to combine remoting with :ref:`routing-scala`.
|
It is absolutely feasible to combine remoting with :ref:`routing-scala`.
|
||||||
This is also done via configuration::
|
|
||||||
|
|
||||||
akka {
|
A pool of remote deployed routees can be configured as:
|
||||||
actor {
|
|
||||||
deployment {
|
|
||||||
/serviceA/aggregation {
|
|
||||||
router = "round-robin-pool"
|
|
||||||
nr-of-instances = 10
|
|
||||||
target {
|
|
||||||
nodes = ["akka.tcp://app@10.0.0.2:2552", "akka.tcp://app@10.0.0.3:2552"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
This configuration setting will clone the actor “aggregation” 10 times and deploy it evenly distributed across
|
.. includecode:: ../scala/code/docs/routing/RouterDocSpec.scala#config-remote-round-robin-pool
|
||||||
the two given target nodes.
|
|
||||||
|
This configuration setting will clone the actor defined in the ``Props`` of the ``remotePool`` 10
|
||||||
|
times and deploy it evenly distributed across the two given target nodes.
|
||||||
|
|
||||||
|
A group of remote actors can be configured as:
|
||||||
|
|
||||||
|
.. includecode:: ../scala/code/docs/routing/RouterDocSpec.scala#config-remote-round-robin-group
|
||||||
|
|
||||||
|
This configuration setting will send messages to the defined remote actor paths.
|
||||||
|
It requires that you create the destination actors on the remote nodes with matching paths.
|
||||||
|
That is not done by the router.
|
||||||
|
|
||||||
.. _remote-sample-scala:
|
.. _remote-sample-scala:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -186,6 +186,8 @@ The routee actors are created externally from the router:
|
||||||
The paths may contain protocol and address information for actors running on remote hosts.
|
The paths may contain protocol and address information for actors running on remote hosts.
|
||||||
Remoting requires the ``akka-remote`` module to be included in the classpath.
|
Remoting requires the ``akka-remote`` module to be included in the classpath.
|
||||||
|
|
||||||
|
.. includecode:: code/docs/routing/RouterDocSpec.scala#config-remote-round-robin-group
|
||||||
|
|
||||||
Router usage
|
Router usage
|
||||||
^^^^^^^^^^^^
|
^^^^^^^^^^^^
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue