Skip to content

Commit

Permalink
Configure RootActorStarter and RootChildActorStarter on ditto.extensi…
Browse files Browse the repository at this point in the history
…ons level

Signed-off-by: Yannic Klem <yannic.klem@bosch.io>
  • Loading branch information
Yannic92 committed Jul 11, 2022
1 parent 088884d commit d4f215d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,7 @@ protected void startServiceRootActors(final ActorSystem actorSystem, final C ser
injectSystemPropertiesLimits(serviceSpecificConfig);

startMainRootActor(actorSystem, getMainRootActorProps(serviceSpecificConfig, pubSubMediator));
RootActorStarter.get(actorSystem, ScopedConfig.getOrEmpty(actorSystem.settings().config(), "ditto"))
.execute();
RootActorStarter.get(actorSystem, ScopedConfig.dittoExtension(actorSystem.settings().config())).execute();
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ private ConnectivityRootActor(final ConnectivityConfig connectivityConfig,
ConnectionPersistenceOperationsActor.props(pubSubMediator, connectivityConfig.getMongoDbConfig(),
config, connectivityConfig.getPersistenceOperationsConfig()));

final var connectivityRawConfig = ScopedConfig.getOrEmpty(config, "ditto.connectivity");
RootChildActorStarter.get(actorSystem, connectivityRawConfig).execute(getContext());
RootChildActorStarter.get(actorSystem, ScopedConfig.dittoExtension(config)).execute(getContext());


final var cleanupConfig = connectivityConfig.getConnectionConfig().getCleanupConfig();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ private GatewayRootActor(final GatewayConfig gatewayConfig, final ActorRef pubSu
pubSubMediator,
edgeCommandForwarder));

final var gatewayRawConfig = ScopedConfig.getOrEmpty(config, "ditto.gateway");
RootChildActorStarter.get(actorSystem, gatewayRawConfig).execute(getContext());
RootChildActorStarter.get(actorSystem, ScopedConfig.dittoExtension(config)).execute(getContext());

final ActorRef healthCheckActor = createHealthCheckActor(healthCheckConfig);
final var hostname = getHostname(httpConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ private PoliciesRootActor(final PoliciesConfig policiesConfig,
startChildActor(DefaultHealthCheckingActorFactory.ACTOR_NAME, healthCheckingActorProps);
bindHttpStatusRoute(policiesConfig.getHttpConfig(), healthCheckingActor);

final var rawServiceConfig = ScopedConfig.getOrEmpty(actorSystem.settings().config(), "ditto.policies");
RootChildActorStarter.get(actorSystem, rawServiceConfig).execute(getContext());
RootChildActorStarter.get(actorSystem, ScopedConfig.dittoExtension(actorSystem.settings().config()))
.execute(getContext());
}

private static Props getPolicySupervisorActorProps(final SnapshotAdapter<Policy> snapshotAdapter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,8 @@ private ThingsRootActor(final ThingsConfig thingsConfig,

bindHttpStatusRoute(thingsConfig.getHttpConfig(), healthCheckingActor);

final var rawServiceConfig = ScopedConfig.getOrEmpty(actorSystem.settings().config(), "ditto.things");
RootChildActorStarter.get(actorSystem, rawServiceConfig).execute(getContext());

RootChildActorStarter.get(actorSystem, ScopedConfig.dittoExtension(actorSystem.settings().config()))
.execute(getContext());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ private SearchRootActor(final SearchConfig searchConfig, final ActorRef pubSubMe
final var monitoringConfig = mongoDbConfig.getMonitoringConfig();

final DittoMongoClient mongoDbClient = MongoClientExtension.get(actorSystem).getSearchClient();
final var searchRawConfig = ScopedConfig.getOrEmpty(actorSystem.settings().config(), "ditto.search");
RootChildActorStarter.get(actorSystem, searchRawConfig).execute(getContext());
RootChildActorStarter.get(actorSystem, ScopedConfig.dittoExtension(actorSystem.settings().config()))
.execute(getContext());

final var thingsSearchPersistence = getThingsSearchPersistence(searchConfig, mongoDbClient);
final ActorRef searchActor = initializeSearchActor(searchConfig.getLimitsConfig(), thingsSearchPersistence);
Expand Down Expand Up @@ -150,8 +150,10 @@ private static ThingsFieldExpressionFactory getThingsFieldExpressionFactory() {
final Map<String, String> mappings = new HashMap<>(6);
mappings.put(FieldExpressionUtil.FIELD_NAME_THING_ID, FieldExpressionUtil.FIELD_ID);
mappings.put(FieldExpressionUtil.FIELD_NAME_NAMESPACE, FieldExpressionUtil.FIELD_NAMESPACE);
addMapping(mappings, Thing.JsonFields.POLICY_ID); // also present as top-level field in search collection, however not indexed
addMapping(mappings, Thing.JsonFields.REVISION); // also present as top-level field in search collection, however not indexed
addMapping(mappings,
Thing.JsonFields.POLICY_ID); // also present as top-level field in search collection, however not indexed
addMapping(mappings,
Thing.JsonFields.REVISION); // also present as top-level field in search collection, however not indexed
addMapping(mappings, Thing.JsonFields.MODIFIED);
addMapping(mappings, Thing.JsonFields.CREATED);
addMapping(mappings, Thing.JsonFields.DEFINITION);
Expand Down

0 comments on commit d4f215d

Please sign in to comment.