Search in sources :

Example 1 with LoggingAdapter

use of akka.event.LoggingAdapter in project webofneeds by researchstudio-sat.

the class MatcherSolrAppConfiguration method actorSystem.

/**
 * Actor system singleton for this application.
 */
@Bean
public ActorSystem actorSystem() {
    // load the Akka configuration
    String seedNodes = "[";
    for (String seed : clusterConfig.getSeedNodes()) {
        seedNodes += "\"akka.tcp://" + clusterConfig.getName() + "@" + seed.trim() + "\",";
    }
    seedNodes += "]";
    final Config applicationConf = ConfigFactory.load();
    final Config config = ConfigFactory.parseString("akka.cluster.seed-nodes=" + seedNodes).withFallback(ConfigFactory.parseString("akka.remote.netty.tcp.bind-port=" + clusterConfig.getLocalPort())).withFallback(ConfigFactory.parseString("akka.remote.netty.tcp.hostname=" + clusterConfig.getNodeHost())).withFallback(ConfigFactory.parseString("akka.remote.netty.tcp.port=" + clusterConfig.getLocalPort())).withFallback(ConfigFactory.parseString("akka.cluster.roles=[matcher]")).withFallback(ConfigFactory.load(applicationConf));
    ActorSystem system = ActorSystem.create(clusterConfig.getName(), config);
    LoggingAdapter log = Logging.getLogger(system, this);
    log.info("Using Akka system settings: " + system.settings().toString());
    // initialize the application context in the Akka Spring Extension
    SpringExtension.SpringExtProvider.get(system).initialize(applicationContext);
    return system;
}
Also used : ActorSystem(akka.actor.ActorSystem) Config(com.typesafe.config.Config) SolrMatcherConfig(won.matcher.solr.config.SolrMatcherConfig) ClusterConfig(won.matcher.service.common.config.ClusterConfig) LoggingAdapter(akka.event.LoggingAdapter) Bean(org.springframework.context.annotation.Bean)

Example 2 with LoggingAdapter

use of akka.event.LoggingAdapter in project webofneeds by researchstudio-sat.

the class MatcherRescalAppConfiguration method actorSystem.

/**
 * Actor system singleton for this application.
 */
@Bean
public ActorSystem actorSystem() {
    // load the Akka configuration
    String seedNodes = "[";
    for (String seed : clusterConfig.getSeedNodes()) {
        seedNodes += "\"akka.tcp://" + clusterConfig.getName() + "@" + seed.trim() + "\",";
    }
    seedNodes += "]";
    final Config applicationConf = ConfigFactory.load();
    final Config config = ConfigFactory.parseString("akka.cluster.seed-nodes=" + seedNodes).withFallback(ConfigFactory.parseString("akka.remote.netty.tcp.bind-port=" + clusterConfig.getLocalPort())).withFallback(ConfigFactory.parseString("akka.remote.netty.tcp.hostname=" + clusterConfig.getNodeHost())).withFallback(ConfigFactory.parseString("akka.remote.netty.tcp.port=" + clusterConfig.getLocalPort())).withFallback(ConfigFactory.parseString("akka.cluster.roles=[matcher]")).withFallback(ConfigFactory.load(applicationConf));
    ActorSystem system = ActorSystem.create(clusterConfig.getName(), config);
    LoggingAdapter log = Logging.getLogger(system, this);
    log.info("Using Akka system settings: " + system.settings().toString());
    // initialize the application context in the Akka Spring Extension
    SpringExtension.SpringExtProvider.get(system).initialize(applicationContext);
    return system;
}
Also used : ActorSystem(akka.actor.ActorSystem) Config(com.typesafe.config.Config) ClusterConfig(won.matcher.service.common.config.ClusterConfig) LoggingAdapter(akka.event.LoggingAdapter) Bean(org.springframework.context.annotation.Bean)

Example 3 with LoggingAdapter

use of akka.event.LoggingAdapter in project webofneeds by researchstudio-sat.

the class MatcherServiceAppConfiguration method actorSystem.

/**
 * Actor system singleton for this application.
 */
@Bean
public ActorSystem actorSystem() {
    // load the Akka configuration
    String seedNodes = "[";
    for (String seed : clusterConfig.getSeedNodes()) {
        seedNodes += "\"akka.tcp://" + clusterConfig.getName() + "@" + seed.trim() + "\",";
    }
    seedNodes += "]";
    final Config applicationConf = ConfigFactory.load();
    final Config config = ConfigFactory.parseString("akka.cluster.seed-nodes=" + seedNodes).withFallback(ConfigFactory.parseString("akka.remote.netty.tcp.bind-port=" + clusterConfig.getLocalPort())).withFallback(ConfigFactory.parseString("akka.remote.netty.tcp.hostname=" + clusterConfig.getNodeHost())).withFallback(ConfigFactory.parseString("akka.remote.netty.tcp.port=" + clusterConfig.getLocalPort())).withFallback(ConfigFactory.parseString("akka.cluster.roles=[core]")).withFallback(ConfigFactory.load(applicationConf));
    ActorSystem system = ActorSystem.create(clusterConfig.getName(), config);
    LoggingAdapter log = Logging.getLogger(system, this);
    log.info("Using Akka system settings: " + system.settings().toString());
    // initialize the application context in the Akka Spring Extension
    SpringExtension.SpringExtProvider.get(system).initialize(applicationContext);
    return system;
}
Also used : ActorSystem(akka.actor.ActorSystem) Config(com.typesafe.config.Config) ClusterConfig(won.matcher.service.common.config.ClusterConfig) LoggingAdapter(akka.event.LoggingAdapter)

Aggregations

ActorSystem (akka.actor.ActorSystem)3 LoggingAdapter (akka.event.LoggingAdapter)3 Config (com.typesafe.config.Config)3 ClusterConfig (won.matcher.service.common.config.ClusterConfig)3 Bean (org.springframework.context.annotation.Bean)2 SolrMatcherConfig (won.matcher.solr.config.SolrMatcherConfig)1