private static void InitializeENode() { int minWorker, minIOC; // Get the current settings. ThreadPool.GetMinThreads(out minWorker, out minIOC); // Change the minimum number of worker threads to four, but // keep the old setting for minimum asynchronous I/O // completion threads. ThreadPool.SetMinThreads(250, minIOC); ServiceConfigSettings.Initialize(); DataConfigSettings.Initialize(); var assemblies = new[] { Assembly.Load("Lottery.Infrastructure"), Assembly.Load("Lottery.Commands"), Assembly.Load("Lottery.Core"), Assembly.Load("Lottery.Denormalizers.Dapper"), Assembly.Load("Lottery.ProcessManagers"), Assembly.Load("Lottery.EventService") }; _enodeConfiguration = Configuration .Create() .UseAutofac() .RegisterCommonComponents() .UseLog4Net() .UseJsonNet() .RegisterUnhandledExceptionHandler() .CreateENode() .RegisterENodeComponents() .RegisterBusinessComponents(assemblies) .UseSqlServerPublishedVersionStore() .UseEQueue() .UseRedisCache() .BuildContainer() .InitializeSqlServerPublishedVersionStore(DataConfigSettings.ENodeConnectionString) .InitializeBusinessAssemblies(assemblies); ObjectContainer.Resolve <ILoggerFactory>().Create(typeof(Program)).Info("Event service initialized."); }
protected static void Initialize() { if (_enodeConfiguration != null) { CleanupEnode(); } ServiceConfigSettings.Initialize(); DataConfigSettings.Initialize(); InitializeENode(); _logger = ObjectContainer.Resolve <ILoggerFactory>().Create(typeof(TestBase)); _logger.Info("ENode initialized."); _commandService = ObjectContainer.Resolve <ICommandService>(); //ObjectContainer.Resolve<ILockService>().AddLockKey(typeof(LotteryData).Name); }
private void InitializeENode() { ServiceConfigSettings.Initialize(); DataConfigSettings.Initialize(); var assemblies = new[] { Assembly.Load("Lottery.Infrastructure"), Assembly.Load("Lottery.Commands"), Assembly.Load("Lottery.QueryServices"), Assembly.Load("Lottery.QueryServices.Dapper"), Assembly.Load("Lottery.AppService"), Assembly.Load("Lottery.WebApi") }; Configuration .Create() .UseAutofac() .RegisterCommonComponents() .UseLog4Net() .UseJsonNet() .RegisterUnhandledExceptionHandler() .CreateENode() .RegisterENodeComponents() .RegisterBusinessComponents(assemblies) .UseEQueue() .UseRedisCache() .UseAutoMapper("Lottery.Dtos") .UseSqlServerPublishedVersionStore() .BuildContainer() .ClearCache() .InitEmailSeting() .InitializeBusinessAssemblies(assemblies) .InitLotteryEngine() .InitializeSqlServerPublishedVersionStore(DataConfigSettings.ENodeConnectionString) .StartEQueue() .Start(); _logger = ObjectContainer.Resolve <ILoggerFactory>().Create(GetType()); _logger.Info("ENode initialized."); }
private static void InitializeENode() { ServiceConfigSettings.Initialize(); DataConfigSettings.Initialize(); var assemblies = new[] { Assembly.Load("Lottery.Infrastructure"), Assembly.Load("Lottery.Commands"), Assembly.Load("Lottery.Core"), Assembly.Load("Lottery.Denormalizers.Dapper"), Assembly.Load("Lottery.CommandHandlers"), Assembly.Load("Lottery.CommandService"), }; // var setting = new ConfigurationSetting(DataConfigSettings.ENodeConnectionString); _enodeConfiguration = Configuration .Create() .UseAutofac() .RegisterCommonComponents() .UseLog4Net() .UseJsonNet() .RegisterUnhandledExceptionHandler() .CreateENode() .RegisterENodeComponents() .RegisterBusinessComponents(assemblies) .UseSqlServerEventStore() .UseSqlServerLockService() .UseEQueue() .UseRedisCache() .BuildContainer() .InitializeBusinessAssemblies(assemblies) .InitializeSqlServerEventStore(DataConfigSettings.ENodeConnectionString) .InitializeSqlServerLockService(DataConfigSettings.ENodeConnectionString) .Start(); }
static BaseQueryService() { DataConfigSettings.Initialize(); }
public static void InitializeFramework() { ServiceConfigSettings.Initialize(); DataConfigSettings.Initialize(); InitializeENodeFramework(); }