Class FromConfig

java.lang.Object
org.apache.pekko.routing.FromConfig
All Implemented Interfaces:
Serializable, Pool, RouterConfig
Direct Known Subclasses:
FromConfig$

public class FromConfig extends Object implements Pool
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 Details

    • FromConfig

      public FromConfig(scala.Option<Resizer> resizer, SupervisorStrategy supervisorStrategy, String routerDispatcher)
    • FromConfig

      public FromConfig()
  • Method Details

    • getInstance

      public static FromConfig$ getInstance()
      Java API: get the singleton instance
    • apply

      public static final FromConfig apply(scala.Option<Resizer> resizer, SupervisorStrategy supervisorStrategy, String routerDispatcher)
    • apply$default$1

      public static final scala.Option<Resizer> apply$default$1()
    • apply$default$2

      public static final SupervisorStrategy apply$default$2()
    • apply$default$3

      public static final String apply$default$3()
    • unapply

      public static final scala.Option<String> unapply(FromConfig fc)
    • productPrefix

      public static String productPrefix()
    • productArity

      public static int productArity()
    • productElement

      public static Object productElement(int x$1)
    • productIterator

      public static scala.collection.Iterator<Object> productIterator()
    • canEqual

      public static boolean canEqual(Object x$1)
    • hashCode

      public static int hashCode()
    • toString

      public static String toString()
    • routingLogicController

      public static scala.Option<Props> routingLogicController(RoutingLogic routingLogic)
    • isManagementMessage

      public static boolean isManagementMessage(Object msg)
    • withFallback

      public static RouterConfig withFallback(RouterConfig other)
    • usePoolDispatcher

      public static boolean usePoolDispatcher()
    • stopRouterWhenAllRouteesRemoved

      public static boolean stopRouterWhenAllRouteesRemoved()
    • equals

      public abstract static boolean equals(Object that)
    • productElementName

      public static String productElementName(int n)
    • productElementNames

      public static scala.collection.Iterator<String> productElementNames()
    • resizer

      public scala.Option<Resizer> resizer()
      Description copied from interface: Pool
      Pool with dynamically resizable number of routees return the pekko.routing.Resizer to 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.
      Specified by:
      resizer in interface Pool
    • supervisorStrategy

      public SupervisorStrategy supervisorStrategy()
      Description copied from interface: Pool
      SupervisorStrategy for the head actor, i.e. for supervising the routees of the pool.
      Specified by:
      supervisorStrategy in interface Pool
    • routerDispatcher

      public String routerDispatcher()
      Description copied from interface: RouterConfig
      Dispatcher ID to use for running the &ldquo;head&rdquo; actor, which handles supervision, death watch and router management messages
      Specified by:
      routerDispatcher in interface RouterConfig
    • createRouter

      public Router createRouter(ActorSystem system)
      Description copied from interface: RouterConfig
      Create the actual router, responsible for routing messages to routees.

      Specified by:
      createRouter in interface RouterConfig
      Parameters:
      system - the ActorSystem this router belongs to
    • verifyConfig

      public void verifyConfig(ActorPath path)
      Description copied from interface: RouterConfig
      Check that everything is there which is needed. Called in constructor of RoutedActorRef to fail early.
      Specified by:
      verifyConfig in interface RouterConfig
    • withSupervisorStrategy

      public FromConfig withSupervisorStrategy(SupervisorStrategy strategy)
      Setting the supervisor strategy to be used for the &ldquo;head&rdquo; Router actor.
    • withResizer

      public FromConfig withResizer(Resizer resizer)
      Setting the resizer to be used.
    • withDispatcher

      public FromConfig withDispatcher(String dispatcherId)
      Setting the dispatcher to be used for the router head actor, which handles supervision, death watch and router management messages.
    • nrOfInstances

      public int nrOfInstances(ActorSystem sys)
      Description copied from interface: Pool
      Initial number of routee instances
      Specified by:
      nrOfInstances in interface Pool
    • props

      public Props props()
      pekko.actor.Props for a group router based on the settings defined by this instance.