diff --git a/akka-actor/src/main/scala/akka/routing/RouterConfig.scala b/akka-actor/src/main/scala/akka/routing/RouterConfig.scala index 27f4df9085..1385ca9ba5 100644 --- a/akka-actor/src/main/scala/akka/routing/RouterConfig.scala +++ b/akka-actor/src/main/scala/akka/routing/RouterConfig.scala @@ -273,7 +273,9 @@ abstract class CustomRouterConfig extends RouterConfig { } /** - * Router configuration which has no default, i.e. external configuration is required. + * Wraps a [[akka.actor.Props]] to mark the actor as externally configurable to be used with a router. + * If a [[akka.actor.Props]] is not wrapped with [[FromConfig]] then the actor will ignore the router part of the deployment section + * in the configuration. */ case object FromConfig extends FromConfig { /** @@ -290,7 +292,9 @@ case object FromConfig extends FromConfig { } /** - * Java API: Router configuration which has no default, i.e. external configuration is required. + * Java API: Wraps a [[akka.actor.Props]] to mark the actor as externally configurable to be used with a router. + * If a [[akka.actor.Props]] is not wrapped with [[FromConfig]] then the actor will ignore the router part of the deployment section + * in the configuration. * * This can be used when the dispatcher to be used for the head Router needs to be configured * (defaults to default-dispatcher). diff --git a/akka-docs/rst/java/routing.rst b/akka-docs/rst/java/routing.rst index 3ebfe3ee40..6ecde18c1b 100644 --- a/akka-docs/rst/java/routing.rst +++ b/akka-docs/rst/java/routing.rst @@ -64,11 +64,11 @@ This type of router actor comes in two distinct flavors: * Group - The routee actors are created externally to the router and the router sends messages to the specified path using actor selection, without watching for termination. -The settings for a router actor can be defined in configuration or programmatically. -Although router actors can be defined in the configuration file, they must still be created -programmatically, i.e. you cannot make a router through external configuration alone. -If you define the router actor in the configuration file then these settings will be used -instead of any programmatically provided parameters. +The settings for a router actor can be defined in configuration or programmatically. +In order to make an actor to make use of an externally configurable router the ``FromConfig`` props wrapper must be used +to denote that the actor accepts routing settings from configuration. +This is in contrast with Remote Deployment where such marker props is not necessary. +If the props of an actor is NOT wrapped in ``FromConfig`` it will ignore the router section of the deployment configuration. You send messages to the routees via the router actor in the same way as for ordinary actors, i.e. via its ``ActorRef``. The router actor forwards messages onto its routees without changing diff --git a/akka-docs/rst/scala/routing.rst b/akka-docs/rst/scala/routing.rst index bb04f40870..6456209388 100644 --- a/akka-docs/rst/scala/routing.rst +++ b/akka-docs/rst/scala/routing.rst @@ -66,10 +66,10 @@ This type of router actor comes in two distinct flavors: messages to the specified path using actor selection, without watching for termination. The settings for a router actor can be defined in configuration or programmatically. -Although router actors can be defined in the configuration file, they must still be created -programmatically, i.e. you cannot make a router through external configuration alone. -If you define the router actor in the configuration file then these settings will be used -instead of any programmatically provided parameters. +In order to make an actor to make use of an externally configurable router the ``FromConfig`` props wrapper must be used +to denote that the actor accepts routing settings from configuration. +This is in contrast with Remote Deployment where such marker props is not necessary. +If the props of an actor is NOT wrapped in FromConfig it will ignore the router section of the deployment configuration. You send messages to the routees via the router actor in the same way as for ordinary actors, i.e. via its ``ActorRef``. The router actor forwards messages onto its routees without changing