I´m working with Akka typed, and I´m not able checking in the official documentation(https://doc.akka.io/docs/akka/current/typed/actors.html#actors), which I found really short, how to configure the Dispatcher in the Actor typed.
Here an example of my code
private int actorTimeout = Integer.parseInt(getProperty("environment.actor.timeout", "10"));
@Autowired
private AkkaTypedDAO akkaTypedDAO;
private ActorSystem<AkkaTypedDTO> system;
@PostConstruct
private void initActor() {
system = ActorSystem.create(akkaTypedDAO.daoWithSupervisor, "AkkaTypedDAO");
}
private final Behavior<CommandAkkaTyped> service = Actor.immutable((ctx, msg) -> {
sendToDAO(msg.id).thenApply(either -> {
msg.replyTo.tell(either);
return either;
});
return Actor.same();
});
public final Behavior<CommandAkkaTyped> serviceWithSupervisor = Actor.supervise(service).onFailure(Exception.class, restart());
private CompletionStage<Either<ConnectorErrorVO, EntityDaoDTO>> sendToDAO(MUSIn<AkkaTypedPayLoad> id) {
return AskPattern.ask(system,
(ActorRef<Either<ConnectorErrorVO, EntityDaoDTO>> replyTo) -> new AkkaTypedDTO(new EntityDaoDTO(musIn), replyTo),
new Timeout(actorTimeout, TimeUnit.SECONDS), system.scheduler());
}
When I create my ActorSystem how can I configure the dispatcher for my Actor.immutable?