private <C extends AbstractConciergeConfigReader> ConciergeRootActor(final C configReader, final ActorRef pubSubMediator, final AbstractEnforcerActorFactory<C> authorizationProxyPropsFactory, final ActorMaterializer materializer) { requireNonNull(configReader); requireNonNull(pubSubMediator); requireNonNull(authorizationProxyPropsFactory); requireNonNull(materializer); final ActorContext context = getContext(); final ActorRef conciergeShardRegion = authorizationProxyPropsFactory.startEnforcerActor(context, configReader, pubSubMediator); retrieveStatisticsDetailsResponseSupplier = RetrieveStatisticsDetailsResponseSupplier.of(conciergeShardRegion, ConciergeMessagingConstants.SHARD_REGION, log); final ActorRef conciergeForwarder = startChildActor(context, ConciergeForwarderActor.ACTOR_NAME, ConciergeForwarderActor.props(pubSubMediator, conciergeShardRegion)); pubSubMediator.tell(new DistributedPubSubMediator.Put(getSelf()), getSelf()); pubSubMediator.tell(new DistributedPubSubMediator.Put(conciergeForwarder), getSelf()); startClusterSingletonActor(context, BatchSupervisorActor.ACTOR_NAME, BatchSupervisorActor.props(pubSubMediator, conciergeForwarder)); final ActorRef healthCheckingActor = startHealthCheckingActor(context, configReader); final HttpConfigReader httpConfig = configReader.http(); bindHttpStatusRoute(healthCheckingActor, httpConfig, materializer); }
" process events again")); pubSubMediator.tell(new DistributedPubSubMediator.Put(getSelf()), getSelf());
" process events again")); pubSubMediator.tell(new DistributedPubSubMediator.Put(getSelf()), getSelf());
PoliciesPersistenceStreamingActorCreator.props(config, tagsStreamingCacheSize)); pubSubMediator.tell(new DistributedPubSubMediator.Put(getSelf()), getSelf()); pubSubMediator.tell(new DistributedPubSubMediator.Put(persistenceStreamingActor), getSelf());
ProxyActor.props(pubSubMediator, devOpsCommandsActor, conciergeForwarder)); pubSubMediator.tell(new DistributedPubSubMediator.Put(getSelf()), getSelf());
ThingsPersistenceStreamingActorCreator.props(config, tagsStreamingCacheSize)); pubSubMediator.tell(new DistributedPubSubMediator.Put(getSelf()), getSelf()); pubSubMediator.tell(new DistributedPubSubMediator.Put(persistenceStreamingActor), getSelf());
private SearchRootActor(final ServiceConfigReader configReader, final ActorRef pubSubMediator, final ActorMaterializer materializer) { final Config rawConfig = configReader.getRawConfig(); final CommandListener kamonCommandListener = rawConfig.getBoolean(ConfigKeys.MONITORING_COMMANDS_ENABLED) ? new KamonCommandListener(KAMON_METRICS_PREFIX) : null; final ConnectionPoolListener kamonConnectionPoolListener = rawConfig.getBoolean(ConfigKeys.MONITORING_CONNECTION_POOL_ENABLED) ? new KamonConnectionPoolListener(KAMON_METRICS_PREFIX) : null; final MongoClientWrapper mongoClientWrapper = MongoClientWrapper.newInstance(rawConfig, kamonCommandListener, kamonConnectionPoolListener); final StreamMetadataPersistence thingsSyncPersistence = MongoSearchSyncPersistence.initializedInstance(THINGS_SYNC_STATE_COLLECTION_NAME, mongoClientWrapper, materializer); final StreamMetadataPersistence policiesSyncPersistence = MongoSearchSyncPersistence.initializedInstance(POLICIES_SYNC_STATE_COLLECTION_NAME, mongoClientWrapper, materializer); final ActorRef searchActor = initializeSearchActor(configReader, mongoClientWrapper); final ActorRef healthCheckingActor = initializeHealthCheckActor(configReader, thingsSyncPersistence, policiesSyncPersistence); pubSubMediator.tell(new DistributedPubSubMediator.Put(searchActor), getSelf()); createHealthCheckingActorHttpBinding(configReader.http(), healthCheckingActor, materializer); startChildActor(SearchUpdaterRootActor.ACTOR_NAME, SearchUpdaterRootActor.props(configReader, pubSubMediator, materializer, thingsSyncPersistence, policiesSyncPersistence)); }
/** * Tell PubSubMediator about self so that other actors may send messages here from other cluster nodes. * * @param self ActorRef of this actor. * @param pubSubMediator Akka PubSub mediator. */ private static void putSelfToPubSubMediator(final ActorRef self, final ActorRef pubSubMediator) { pubSubMediator.tell(new DistributedPubSubMediator.Put(self), self); } }
private BlockedNamespacesUpdater(final BlockedNamespaces blockedNamespaces, final ActorRef pubSubMediator) { this.blockedNamespaces = blockedNamespaces; // register self for pub-sub on restart pubSubMediator.tell(new Put(getSelf()), getSelf()); // subscribe to namespace-blocking commands pubSubMediator.tell(new DistributedPubSubMediator.Subscribe(BlockNamespace.TYPE, getSelf()), getSelf()); pubSubMediator.tell(new DistributedPubSubMediator.Subscribe(UnblockNamespace.TYPE, getSelf()), getSelf()); }
@Override public void preStart() { pubSubMediator.tell(new DistributedPubSubMediator.Put(getSelf()), getSelf()); pubSubMediator.tell(new DistributedPubSubMediator.Subscribe(BatchExecutionFinished.TYPE, ACTOR_NAME, getSelf()), getSelf()); }