public void Start() { var actorSystemName = "akka-cluster"; var hoconConfig = ConfigurationFactory.ParseString(File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + "application.conf")); var config = hoconConfig.GetConfig("cluster-management"); if (config != null) { actorSystemName = config.GetString("actorsystem", actorSystemName); } actorSystem = ActorSystem.Create(actorSystemName, hoconConfig); Cluster.Get(actorSystem).RegisterOnMemberUp(() => { ClusterSharding.Get(actorSystem).Start( typeName: "my-actor", entityProps: Props.Create <MyActor>(), settings: ClusterShardingSettings.Create(actorSystem), messageExtractor: new MessageExtractor()); }); // Akka Management hosts the HTTP routes used by bootstrap ClusterHttpManagement.Get(actorSystem).Start(); }
public void Start() { var str = "cluster-management-system"; var config = ((AkkaConfigurationSection)ConfigurationManager.GetSection("akka")).AkkaConfig.GetConfig("cluster-management"); if (config != null) { str = config.GetString("actorsystem", str); } system = ActorSystem.Create(str); ClusterHttpManagement.Get(system).Start(); Console.WriteLine("Press Enter to exit..."); Console.ReadLine(); }
public void Stop() { ClusterHttpManagement.Get(actorSystem).Stop(); CoordinatedShutdown.Get(actorSystem).Run(CoordinatedShutdown.ClrExitReason.Instance).Wait(); }
public void Stop() { ClusterHttpManagement.Get(system).Stop(); system.Terminate(); }