Package org.apache.pekko.routing
Class FromConfig
java.lang.Object
org.apache.pekko.routing.FromConfig
- All Implemented Interfaces:
Serializable,Pool,RouterConfig
- Direct Known Subclasses:
FromConfig$
Java API: Wraps a
pekko.actor.Props to mark the actor as externally configurable to be used with a router.
If a pekko.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).
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFromConfig(scala.Option<Resizer> resizer, SupervisorStrategy supervisorStrategy, String routerDispatcher) -
Method Summary
Modifier and TypeMethodDescriptionstatic final FromConfigapply(scala.Option<Resizer> resizer, SupervisorStrategy supervisorStrategy, String routerDispatcher) static final scala.Option<Resizer>static final SupervisorStrategystatic final Stringstatic booleancreateRouter(ActorSystem system) Create the actual router, responsible for routing messages to routees.abstract static booleanstatic FromConfig$Java API: get the singleton instancestatic inthashCode()static booleanintnrOfInstances(ActorSystem sys) Initial number of routee instancesstatic intstatic ObjectproductElement(int x$1) static StringproductElementName(int n) static scala.collection.Iterator<String>static scala.collection.Iterator<Object>static Stringprops()pekko.actor.Propsfor a group router based on the settings defined by this instance.scala.Option<Resizer>resizer()Pool with dynamically resizable number of routees return thepekko.routing.Resizerto use.Dispatcher ID to use for running the “head” actor, which handles supervision, death watch and router management messagesstatic scala.Option<Props>routingLogicController(RoutingLogic routingLogic) static booleanSupervisorStrategy for the head actor, i.e.static StringtoString()static final scala.Option<String>unapply(FromConfig fc) static booleanvoidverifyConfig(ActorPath path) Check that everything is there which is needed.withDispatcher(String dispatcherId) Setting the dispatcher to be used for the router head actor, which handles supervision, death watch and router management messages.static RouterConfigwithFallback(RouterConfig other) withResizer(Resizer resizer) Setting the resizer to be used.withSupervisorStrategy(SupervisorStrategy strategy) Setting the supervisor strategy to be used for the “head” Router actor.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pekko.routing.Pool
enrichWithPoolDispatcher, newRoutee, props, stopRouterWhenAllRouteesRemoved, usePoolDispatcherMethods inherited from interface org.apache.pekko.routing.RouterConfig
isManagementMessage, routingLogicController, withFallback
-
Constructor Details
-
FromConfig
public FromConfig(scala.Option<Resizer> resizer, SupervisorStrategy supervisorStrategy, String routerDispatcher) -
FromConfig
public FromConfig()
-
-
Method Details
-
getInstance
Java API: get the singleton instance -
apply
public static final FromConfig apply(scala.Option<Resizer> resizer, SupervisorStrategy supervisorStrategy, String routerDispatcher) -
apply$default$1
-
apply$default$2
-
apply$default$3
-
unapply
-
productPrefix
-
productArity
public static int productArity() -
productElement
-
productIterator
-
canEqual
-
hashCode
public static int hashCode() -
toString
-
routingLogicController
-
isManagementMessage
-
withFallback
-
usePoolDispatcher
public static boolean usePoolDispatcher() -
stopRouterWhenAllRouteesRemoved
public static boolean stopRouterWhenAllRouteesRemoved() -
equals
-
productElementName
-
productElementNames
-
resizer
Description copied from interface:PoolPool with dynamically resizable number of routees return thepekko.routing.Resizerto use. The resizer is invoked once when the router is created, before any messages can be sent to it. Resize is also triggered when messages are sent to the routees, and the resizer is invoked asynchronously, i.e. not necessarily before the message has been sent. -
supervisorStrategy
Description copied from interface:PoolSupervisorStrategy for the head actor, i.e. for supervising the routees of the pool.- Specified by:
supervisorStrategyin interfacePool
-
routerDispatcher
Description copied from interface:RouterConfigDispatcher ID to use for running the “head” actor, which handles supervision, death watch and router management messages- Specified by:
routerDispatcherin interfaceRouterConfig
-
createRouter
Description copied from interface:RouterConfigCreate the actual router, responsible for routing messages to routees.- Specified by:
createRouterin interfaceRouterConfig- Parameters:
system- the ActorSystem this router belongs to
-
verifyConfig
Description copied from interface:RouterConfigCheck that everything is there which is needed. Called in constructor of RoutedActorRef to fail early.- Specified by:
verifyConfigin interfaceRouterConfig
-
withSupervisorStrategy
Setting the supervisor strategy to be used for the “head” Router actor. -
withResizer
Setting the resizer to be used. -
withDispatcher
Setting the dispatcher to be used for the router head actor, which handles supervision, death watch and router management messages. -
nrOfInstances
Description copied from interface:PoolInitial number of routee instances- Specified by:
nrOfInstancesin interfacePool
-
props
pekko.actor.Propsfor a group router based on the settings defined by this instance.
-