Hi,
I'm having trouble making consistent-hashing-pool work. I'm using Akka with under Play and inject Akka Actors with Guice. Everything looks fine but according to logs my tasks are executed by default dispatcher. I expect them to be run by hashing-pool. Could you please check my configuration and tell me if I'm missing something?
My application.conf
akka {
actor {
deployment {
...
/campaign-activity-router {
router = consistent-hashing-pool
nr-of-instances = 10
virtual-nodes-factor = 10
}
}
My module
public class AdsModule extends AbstractModule implements AkkaGuiceSupport {
public void configure() {
bindActor(CampaignActivityActor.class, "campaign-activity-router", this::applyActorProps);
}
private Props applyActorProps(final Props props) {
return props.withRouter(FromConfig.getInstance().withSupervisorStrategy(newAlwaysRestartOnlyActorSupervisorStrategy()));
}
private SupervisorStrategy newAlwaysRestartOnlyActorSupervisorStrategy() {
return new OneForOneStrategy(-1, Duration.Inf(), throwable -> SupervisorStrategy.restart(), true);
}
}
My message class
public class Message implements ConsistentHashingRouter.ConsistentHashable, Serializable {
private final Subscriber subscriber;
public Object consistentHashKey() {
return subscriber.getId();
}
}
Caller code
@Inject
@Named("campaign-activity-router")
private ActorRef campaignActivityActorRouter;
this.campaignActivityActorRouter.tell...
Thanks