diff --git a/akka-docs/rst/java/remoting.rst b/akka-docs/rst/java/remoting.rst index 1751ed4958..85b48e1a44 100644 --- a/akka-docs/rst/java/remoting.rst +++ b/akka-docs/rst/java/remoting.rst @@ -254,24 +254,21 @@ Routers with Remote Destinations ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ It is absolutely feasible to combine remoting with :ref:`routing-java`. -This is also done via configuration:: - akka { - 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"] - } - } - } - } - } +A pool of remote deployed routees can be configured as: -This configuration setting will clone the actor “aggregation” 10 times and deploy it evenly distributed across -the two given target nodes. +.. includecode:: ../scala/code/docs/routing/RouterDocSpec.scala#config-remote-round-robin-pool + +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: diff --git a/akka-docs/rst/java/routing.rst b/akka-docs/rst/java/routing.rst index 3057e25bec..a2d002303f 100644 --- a/akka-docs/rst/java/routing.rst +++ b/akka-docs/rst/java/routing.rst @@ -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. 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 ^^^^^^^^^^^^ diff --git a/akka-docs/rst/scala/code/docs/routing/RouterDocSpec.scala b/akka-docs/rst/scala/code/docs/routing/RouterDocSpec.scala index 01fa5e2a4a..bde8090881 100644 --- a/akka-docs/rst/scala/code/docs/routing/RouterDocSpec.scala +++ b/akka-docs/rst/scala/code/docs/routing/RouterDocSpec.scala @@ -149,6 +149,28 @@ akka.actor.deployment { } #//#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 akka.actor.deployment { /parent/router25 { diff --git a/akka-docs/rst/scala/remoting.rst b/akka-docs/rst/scala/remoting.rst index 028c60e8f8..53cbff2e11 100644 --- a/akka-docs/rst/scala/remoting.rst +++ b/akka-docs/rst/scala/remoting.rst @@ -261,24 +261,21 @@ Routers with Remote Destinations ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ It is absolutely feasible to combine remoting with :ref:`routing-scala`. -This is also done via configuration:: - akka { - 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"] - } - } - } - } - } +A pool of remote deployed routees can be configured as: -This configuration setting will clone the actor “aggregation” 10 times and deploy it evenly distributed across -the two given target nodes. +.. includecode:: ../scala/code/docs/routing/RouterDocSpec.scala#config-remote-round-robin-pool + +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: diff --git a/akka-docs/rst/scala/routing.rst b/akka-docs/rst/scala/routing.rst index d4d9ce1672..aa5e3658fd 100644 --- a/akka-docs/rst/scala/routing.rst +++ b/akka-docs/rst/scala/routing.rst @@ -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. 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 ^^^^^^^^^^^^