public void Sql_journal_is_available_for_factored_akka_cluster()
        {
            var actorSystem = ActorSystemFactory.CreateCluster(_conf, 2, 2).RandomNode();
            var actor       = actorSystem.ActorOf(Props.Create <SqlJournalPingActor>(TestActor), nameof(SqlJournalPingActor));

            CHeckPersist(actor);
        }
Example #2
0
        public static async Task <MopHost> BuildHost(string[] args, CancellationToken token)
        {
            var props = await HostPropertiesFactory.BuildPropertiesAsync(args);

            var injector   = new InjectorService();
            var mainSystem = ActorSystemFactory.BuildFrom(props);

            injector.RegisterService(() => props, LifeCycle.Singleton);
            injector.RegisterService(() => new MopLifeService(token), LifeCycle.Singleton);
            injector.RegisterService(() => mainSystem, LifeCycle.Singleton);
            injector.RegisterService <IInjectorService>(() => injector, LifeCycle.Singleton);
            injector.RegisterService <IRIPService, RIPService>(LifeCycle.Singleton);
            injector.RegisterService <IHost, MopHost>(LifeCycle.Singleton);
            injector.RegisterService <ILogService, LogService>(LifeCycle.Singleton);
            injector.RegisterService <IConfigService, ConfigService>(LifeCycle.Singleton);
            injector.RegisterService <IEventService, EventService>(LifeCycle.Singleton);
            injector.RegisterService <PluginLoader>(LifeCycle.Transient);
            injector.RegisterService <IPluginService, PluginService>(LifeCycle.Singleton);
            injector.RegisterService <AssemblyResolver>(LifeCycle.Transient);

            if (injector.GetService <AssemblyResolver>() is AssemblyResolver r)
            {
                r.RegisterAppDomain(AppDomain.CurrentDomain);
            }

            if (injector.GetService <IHost>() is MopHost host)
            {
                return(host);
            }

            throw new Exception("Failed to instantiate host");
        }
Example #3
0
        private static void Main(string[] args)
        {
            Console.WriteLine("Welcome to GridDomain");
            Console.WriteLine("Launching GridDomain node");

            var container  = new UnityContainer();
            var akkaConfig = container.Resolve <AkkaConfiguration>();
            var conf       = new LocalDbConfiguration();

            CompositionRoot.Init(container, conf);

            HostFactory.Run(x =>
            {
                x.Service <GridDomainNode>(s =>
                {
                    s.ConstructUsing(settings =>
                    {
                        var actorSystem = ActorSystemFactory.CreateCluster(akkaConfig).RandomNode();
                        return(new GridDomainNode(container, new BusinessNewsRouting(), new PersistedQuartzConfig(), actorSystem));
                    });
                    s.WhenStarted(node =>
                    {
                        node.Start(conf);
                        ApplySeeds(node);
                    });
                    s.WhenStopped(tc => tc.Stop());
                });

                x.RunAsLocalSystem();
                x.SetDescription("GridDomain node host");
                x.SetDisplayName("GridDomain node");
                x.SetServiceName("GridDomain_node");
            });
            Console.ReadLine();
        }
        protected override ActorSystem CreateSystem(AkkaConfiguration conf)
        {
            Nodes = ActorSystemFactory.CreateCluster(AkkaConfig).NonSeedNodes;
            var actorSystem = Nodes.Last();

            _transport = new DistributedPubSubTransport(actorSystem);
            return(actorSystem);
        }
        protected override GridDomainNode CreateGridDomainNode(AkkaConfiguration akkaConf, IDbConfiguration dbConfig)
        {
            _akkaCluster = ActorSystemFactory.CreateCluster(new AutoTestAkkaConfiguration());
            var unityContainer = CreateUnityContainer(dbConfig);

            return(new GridDomainNode(unityContainer,
                                      new BusinessNewsRouting(),
                                      TransportMode.Cluster, _akkaCluster.All));
        }
Example #6
0
        public void InitializeClusterSystem()
        {
            Program.ClusterSystem = ActorSystemFactory.LaunchClusterManager();

            GlobalContext.Properties["ipaddress"] = AppSettings.GetIpAddressFromConfig();

            Program.ClusterHelper = Program.ClusterSystem.ActorOf(Props.Create(() => new ClusterHelper()), ActorPaths.ClusterHelperActor.Name);

            Program.ClusterSystem.ActorOf(ClusterSingletonManager.Props(
                                              singletonProps: Props.Create(() => new JobManager()),                                        // Props used to create actor singleton
                                              terminationMessage: PoisonPill.Instance,                                                     // message used to stop actor gracefully
                                              settings: ClusterSingletonManagerSettings.Create(Program.ClusterSystem).WithRole("worker")), // cluster singleton manager settings
                                          name: "jobmanager");
        }
 public WebUIDeploymentHost()
 {
     ActorSystemFactory = new ActorSystemFactory();
 }
Example #8
0
 public void InitializeCluster()
 {
     _lighthouseSystem     = ActorSystemFactory.LaunchClusterManager();
     Program.ClusterSystem = _lighthouseSystem;
     Program.ClusterHelper = Program.ClusterSystem.ActorOf(Props.Create(() => new ClusterHelper()), ActorPaths.ClusterHelperActor.Name);
 }
Example #9
0
        public void Sql_journal_is_available_for_factory_created_cluster_actor_system()
        {
            var actorSystem = ActorSystemFactory.CreateCluster(_conf, 2, 2).RandomNode();

            PingSqlJournal(actorSystem);
        }
Example #10
0
        public void Sql_journal_is_available_for_factory_created_actor_system()
        {
            var actorSystem = ActorSystemFactory.CreateActorSystem(_conf);

            PingSqlJournal(actorSystem);
        }
 protected override GridDomainNode CreateGridDomainNode(AkkaConfiguration akkaConf, IDbConfiguration dbConfig)
 {
     return(new GridDomainNode(CreateUnityContainer(dbConfig),
                               new BusinessNewsRouting(),
                               TransportMode.Standalone, ActorSystemFactory.CreateActorSystem(akkaConf)));
 }
Example #12
0
 public void InitializeCluster()
 {
     Program.MyActorSystem = ActorSystemFactory.LaunchClusterManager(systemNameTB.Text, ipAddressTB.Text, Convert.ToInt32(portTB.Text));
     loggerBox.Items.Insert(0, string.Format("{0}  {1}", DateTime.Now.ToString("MM-dd-yy hh:mm:ss.fff"), "Actor System Started"));
     InitializeActors();
 }
Example #13
0
 public ActorService(ISettingsService settings)
 {
     _settings   = settings;
     ActorSystem = new ActorSystemFactory(_settings).Build();
     Cluster     = Cluster.Get(ActorSystem);
 }
 public void StopServer()
 {
     ActorSystemFactory.TerminateActorSystem();
 }
 public InventoryServiceServerApp()
 {
     ActorSystemFactory = new ActorSystemFactory();
 }