Configure Akka ClusterRouting programmatically
<p>When configuring the Cluster Routing in the config file using:</p>

<pre><code>akka.actor.deployment {
    /jobDispatcher/singleton/workerRouter {
        router = round-robin-pool
        nr-of-instances = 5
        cluster {
            enabled = on
            max-number-of-instances-per-node = 1
            allow-local-routees = on
        }
    }
}
</code></pre>

<p>I can lookup a routed worker using:</p>

<pre><code>ActorRef actor = context().actorOf( //
  FromConfig.getInstance().props( //
    Props.create(MyRoutedActor.class)), //
  "workerRouter");
</code></pre>

<p>I would prefer configuring the Pool programmatically since I want to hide the details from my user. </p>

<p>However using:</p>

<pre><code>ActorRef actor = context().actorOf(new ClusterRouterPool(new RoundRobinPool(5), //
  new ClusterRouterPoolSettings(100, 1, true, "")) //
    .props(Props.create(MyRoutedActor.class)),
  "workerRouter");
</code></pre>

<p>does not route the calls to Routees in the cluster (only the local .</p>

<p>How do I configure the routing correctly?</p>