Search in sources :

Example 1 with TbActorSystemSettings

use of org.thingsboard.server.actors.TbActorSystemSettings in project thingsboard by thingsboard.

the class DefaultActorService method initActorSystem.

@PostConstruct
public void initActorSystem() {
    log.info("Initializing actor system.");
    actorContext.setActorService(this);
    TbActorSystemSettings settings = new TbActorSystemSettings(actorThroughput, schedulerPoolSize, maxActorInitAttempts);
    system = new DefaultTbActorSystem(settings);
    system.createDispatcher(APP_DISPATCHER_NAME, initDispatcherExecutor(APP_DISPATCHER_NAME, appDispatcherSize));
    system.createDispatcher(TENANT_DISPATCHER_NAME, initDispatcherExecutor(TENANT_DISPATCHER_NAME, tenantDispatcherSize));
    system.createDispatcher(DEVICE_DISPATCHER_NAME, initDispatcherExecutor(DEVICE_DISPATCHER_NAME, deviceDispatcherSize));
    system.createDispatcher(RULE_DISPATCHER_NAME, initDispatcherExecutor(RULE_DISPATCHER_NAME, ruleDispatcherSize));
    actorContext.setActorSystem(system);
    appActor = system.createRootActor(APP_DISPATCHER_NAME, new AppActor.ActorCreator(actorContext));
    actorContext.setAppActor(appActor);
    TbActorRef statsActor = system.createRootActor(TENANT_DISPATCHER_NAME, new StatsActor.ActorCreator(actorContext, "StatsActor"));
    actorContext.setStatsActor(statsActor);
    log.info("Actor system initialized.");
}
Also used : StatsActor(org.thingsboard.server.actors.stats.StatsActor) TbActorSystemSettings(org.thingsboard.server.actors.TbActorSystemSettings) DefaultTbActorSystem(org.thingsboard.server.actors.DefaultTbActorSystem) TbActorRef(org.thingsboard.server.actors.TbActorRef) PostConstruct(javax.annotation.PostConstruct)

Aggregations

PostConstruct (javax.annotation.PostConstruct)1 DefaultTbActorSystem (org.thingsboard.server.actors.DefaultTbActorSystem)1 TbActorRef (org.thingsboard.server.actors.TbActorRef)1 TbActorSystemSettings (org.thingsboard.server.actors.TbActorSystemSettings)1 StatsActor (org.thingsboard.server.actors.stats.StatsActor)1