public static ActorSystemBuilder SqlPersistence(this ActorSystemBuilder builder, ISqlNodeDbConfiguration conf)
 {
     builder.Add(new PersistenceConfig(new PersistenceJournalConfig(conf ?? throw new ArgumentNullException(nameof(conf)),
                                                                    new DomainEventAdaptersConfig()),
                                       new PersistenceSnapshotConfig(conf)));
     return(builder);
 }
 public static string ToClusterNonSeedNodeSystemConfig(this NodeConfiguration conf, ISqlNodeDbConfiguration persistence, params INodeNetworkAddress[] seeds)
 {
     return(ActorSystemBuilder.New()
            .Log(conf.LogLevel)
            .ClusterNonSeed(conf, seeds)
            .SqlPersistence(persistence)
            .BuildHocon());
 }
示例#3
0
        public void Start()
        {
            Log.Information($"Created shop node {NodeConfiguration.Name} at {NodeConfiguration.Address.Host} on port {NodeConfiguration.Address.PortNumber}");

            var actorSystemFactory = ActorSystemBuilder.New().Build(NodeConfiguration, new ShopNodeDbConfig());

            _gridDomainNode = new GridDomainNode(actorSystemFactory, _logger ?? Log.Logger, new ShopDomainConfiguration(ReadDbConnectionString));
            _gridDomainNode.Start().Wait();
        }
 public static IActorSystemFactory Build(this ActorSystemBuilder builder, NodeConfiguration conf, ISqlNodeDbConfiguration persistence)
 {
     return(builder.Log(conf.LogLevel)
            .DomainSerialization(false)
            .RemoteActorProvider()
            .Remote(conf.Address)
            .SqlPersistence(persistence)
            .BuildActorSystemFactory(conf.Name));
 }
 public static string ToStandAloneSystemConfig(this NodeConfiguration conf, ISqlNodeDbConfiguration persistence, bool serializeMessagesCreators = false)
 {
     return(ActorSystemBuilder.New()
            .Log(conf.LogLevel)
            .DomainSerialization(serializeMessagesCreators)
            .RemoteActorProvider()
            .Remote(conf.Address)
            .SqlPersistence(persistence)
            .BuildHocon());
 }
 private static string GetConfig()
 {
     return(ActorSystemBuilder.New()
            .Log(LogEventLevel.Verbose, null, true)
            .DomainSerialization()
            .RemoteActorProvider()
            .Remote(new NodeNetworkAddress())
            .InMemoryPersistence()
            .BuildHocon());
 }
        public void Should_create_actor_system_using_given_hoconbuilder_and_config_factory()
        {
            var configFactory = A.Fake<IConfigurationFactory>();
            var hoconBuilder = A.Fake<IHoconBuilder>();
            
            var fakeHocon = "akka.stdout-loglevel = DEBUG";
            var fakeConfig = ConfigurationFactory.ParseString(fakeHocon);
            var systemName = "FakeSystem";

            var builder = new ActorSystemBuilder(hoconBuilder, configFactory);

            A.CallTo(() => configFactory.ParseString(A<string>.Ignored))
                .Returns(fakeConfig);

            A.CallTo(() => hoconBuilder.GetHocon(systemName)).Returns(fakeHocon);

            Assert.IsNotNull(builder.Create(systemName));
        }