Exemplo n.º 1
0
        public void Start()
        {
            var conf = new IgniteConfiguration
            {
                IgniteInstanceName = "Billingware.Cache.Main." + Guid.NewGuid().ToString("N"),
                Logger             = new CustomIgniteSerilogLogger(),
                ClientMode         = false,
                // ConsistentId = Guid.NewGuid().ToString("N"),
                WorkDirectory       = AppDomain.CurrentDomain.BaseDirectory,
                MetricsLogFrequency = TimeSpan.Zero,
                // MetricsUpdateFrequency = TimeSpan.Zero,
                Localhost    = "0.0.0.0",
                DiscoverySpi = new TcpDiscoverySpi
                {
                    IpFinder = new TcpDiscoveryStaticIpFinder()
                    {
                        Endpoints = new[]
                        {
                            "localhost"
                        }
                    },
                    LocalPort      = 48500,
                    LocalPortRange = 10,
                },
                CommunicationSpi = new TcpCommunicationSpi
                {
                    LocalPort = 48100
                }
            };

            CommonIgniterService.Start(conf, true);
        }
Exemplo n.º 2
0
        public CreditHandlerActorShould()
        {
            var conf = new IgniteConfiguration
            {
                IgniteInstanceName = "Billingware.Cache.Tests." + Guid.NewGuid().ToString("N"),
                Logger             = new CustomIgniteSerilogLogger(),
                ClientMode         = false,
                // ConsistentId = Guid.NewGuid().ToString("N"),
                WorkDirectory       = AppDomain.CurrentDomain.BaseDirectory,
                MetricsLogFrequency = TimeSpan.Zero,
                // MetricsUpdateFrequency = TimeSpan.Zero,
                Localhost    = "0.0.0.0",
                DiscoverySpi = new TcpDiscoverySpi
                {
                    IpFinder = new TcpDiscoveryStaticIpFinder()
                    {
                        Endpoints = new[]
                        {
                            "localhost"
                        }
                    },
                    LocalPort      = 48500,
                    LocalPortRange = 10,
                },
                CommunicationSpi = new TcpCommunicationSpi
                {
                    LocalPort = 48100
                }
            };

            CommonIgniterService.Start(conf, true);
            ApiDependencyResolverSystem.Start();
            var resolver = new SimpleInjectorDependencyResolver(ApiDependencyResolverSystem.GetContainer(), Sys);

            _creditActorRef = Sys.ActorOf(Sys.DI().Props <CreditRequestActor>(), nameof(CreditRequestActor));
            var accountingActorRef = Sys.ActorOf(Sys.DI().Props <AccountingActor>(), nameof(AccountingActor));

            Sys.EventStream.Subscribe(accountingActorRef, typeof(DebitAccount));
            Sys.EventStream.Subscribe(accountingActorRef, typeof(CreditAccount));
            Sys.EventStream.Subscribe(accountingActorRef, typeof(PersistTransaction));
        }
Exemplo n.º 3
0
 public void Stop()
 {
     CommonIgniterService.Dispose();
 }