public void Start() { Log.Assign(new Log4NetLog(LogManager.GetLogger(typeof(Host)))); _container = new WindsorContainer(); var container = new WindsorComponentContainer(_container); container.RegisterSuffixed("Shuttle.ProcessManagement"); ServiceBus.Register(container); var subscriptionManager = container.Resolve <ISubscriptionManager>(); subscriptionManager.Subscribe <OrderProcessRegisteredEvent>(); subscriptionManager.Subscribe <OrderProcessCancelledEvent>(); subscriptionManager.Subscribe <OrderProcessAcceptedEvent>(); subscriptionManager.Subscribe <OrderProcessCompletedEvent>(); subscriptionManager.Subscribe <OrderProcessArchivedEvent>(); subscriptionManager.Subscribe <OrderCreatedEvent>(); subscriptionManager.Subscribe <CancelOrderProcessRejectedEvent>(); subscriptionManager.Subscribe <ArchiveOrderProcessRejectedEvent>(); subscriptionManager.Subscribe <InvoiceCreatedEvent>(); subscriptionManager.Subscribe <EMailSentEvent>(); _bus = ServiceBus.Create(container).Start(); }
public IServiceProvider ConfigureServices(IServiceCollection services) { services.AddMvc(); services.AddCors(); var container = new WindsorContainer(); var componentContainer = new WindsorComponentContainer(container); componentContainer.RegisterInstance <IAccessConfiguration>(AccessSection.Configuration()); componentContainer.RegisterSuffixed("Shuttle.Sentinel"); componentContainer.RegisterSuffixed("Shuttle.Access.Sql"); componentContainer.Register <IInspectionQueue, DefaultInspectionQueue>(); componentContainer.Register <IHttpContextAccessor, HttpContextAccessor>(); componentContainer.Register <IDatabaseContextCache, ContextDatabaseContextCache>(); ServiceBus.Register(componentContainer); EventStore.Register(componentContainer); componentContainer.Resolve <IDataStoreDatabaseContextFactory>().ConfigureWith("Sentinel"); componentContainer.Resolve <IDatabaseContextFactory>().ConfigureWith("Sentinel"); var inspectionQueue = componentContainer.Resolve <IInspectionQueue>(); _bus = ServiceBus.Create(componentContainer).Start(); return(WindsorRegistrationHelper.CreateServiceProvider(container, services)); }
public void Start() { DbProviderFactories.RegisterFactory("System.Data.SqlClient", SqlClientFactory.Instance); Log.Assign(new Log4NetLog(LogManager.GetLogger(typeof(Host)))); _container = new WindsorContainer(); var container = new WindsorComponentContainer(_container); container.RegisterSuffixed("Shuttle.Abacus"); EventStore.Register(container); ServiceBus.Register(container); container.Register <ArgumentHandler>(); container.Register <FormulaHandler>(); container.Register <MatrixHandler>(); container.Register <TestHandler>(); _eventProcessor = container.Resolve <IEventProcessor>(); _eventProcessor.AddProjection(new Projection("Argument").AddEventHandler(container.Resolve <ArgumentHandler>())); _eventProcessor.AddProjection(new Projection("Formula").AddEventHandler(container.Resolve <FormulaHandler>())); _eventProcessor.AddProjection(new Projection("Matrix").AddEventHandler(container.Resolve <MatrixHandler>())); _eventProcessor.AddProjection(new Projection("Test").AddEventHandler(container.Resolve <TestHandler>())); container.Resolve <IDatabaseContextFactory>().ConfigureWith("Abacus"); _bus = ServiceBus.Create(container).Start(); _eventProcessor.Start(); }
public void Start() { Log.Assign(new Log4NetLog(LogManager.GetLogger(typeof(Host)))); _container = new WindsorContainer(); var container = new WindsorComponentContainer(_container); container.RegisterSuffixed("Shuttle.Access.Sql"); EventStore.Register(container); _eventStore = EventStore.Create(container); container.Register <UserHandler>(); container.Register <RoleHandler>(); _eventProcessor = container.Resolve <IEventProcessor>(); _eventProcessor.AddProjection( new Recall.Projection("SystemUsers").AddEventHandler(container.Resolve <UserHandler>())); _eventProcessor.AddProjection( new Recall.Projection("SystemRoles").AddEventHandler(container.Resolve <RoleHandler>())); _eventProcessor.Start(); }
public void Start() { var container = new WindsorComponentContainer(new WindsorContainer()); ServiceBus.Register(container); _bus = ServiceBus.Create(container).Start(); }
public static ComponentContainer GetComponentContainer() { var container = new WindsorComponentContainer(new WindsorContainer()); container.Register <IMsmqConfiguration, MsmqConfiguration>(); return(new ComponentContainer(container, () => container)); }
public void Start() { var container = new WindsorComponentContainer(new WindsorContainer()); container.Register <IAzureStorageConfiguration, DefaultAzureStorageConfiguration>(); container.RegisterServiceBus(); _bus = container.Resolve <IServiceBus>().Start(); }
public static ComponentContainer GetComponentContainer() { var container = new WindsorComponentContainer(new WindsorContainer()); container.RegisterSqlQueue(); container.RegisterDataAccess(); return(new ComponentContainer(container, () => container)); }
public void ExerciseEventStore() { var container = new WindsorComponentContainer(new WindsorContainer()); EventStore.Register(container); using (container.Resolve <IDatabaseContextFactory>().Create(EventStoreConnectionStringName)) { RecallFixture.ExerciseEventStore(EventStore.Create(container), EventProcessor.Create(container)); } }
public void Start() { Log.Assign(new Log4NetLog(LogManager.GetLogger(typeof(Host)))); _container = new WindsorContainer(); var container = new WindsorComponentContainer(_container); ServiceBus.Register(container); _bus = ServiceBus.Create(container).Start(); }
static IntegrationFixture() { var container = new WindsorComponentContainer(new WindsorContainer()); container.RegistryBoostrap(); container.RegisterSuffixed("Shuttle.SqlServer.Runner.Core"); TransactionScopeFactory = new DefaultTransactionScopeFactory(true, IsolationLevel.ReadCommitted, TimeSpan.FromSeconds(120)); Resolver = container; }
public void ExerciseStorage() { var container = new WindsorComponentContainer(new WindsorContainer()); container.RegisterInstance(new Mock <IProjectionRepository>().Object); EventStore.Register(container); using (container.Resolve <IDatabaseContextFactory>().Create(EventStoreConnectionStringName)) { RecallFixture.ExerciseStorage(EventStore.Create(container)); } }
public void Start() { Log.Assign(new Log4NetLog(LogManager.GetLogger(typeof(Host)))); _container = new WindsorContainer(); var container = new WindsorComponentContainer(_container); container.Register <IAzureStorageConfiguration, DefaultAzureStorageConfiguration>(); container.RegisterServiceBus(); _bus = container.Resolve <IServiceBus>().Start(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, IApplicationLifetime applicationLifetime) { var container = app.ApplicationServices.GetService <IWindsorContainer>(); var componentContainer = new WindsorComponentContainer(container); componentContainer.RegisterSuffixed("Shuttle.Sentinel"); componentContainer.RegisterSuffixed("Shuttle.Access.Sql"); componentContainer.RegisterSuffixed("Shuttle.Esb.Scheduling"); componentContainer.Register <IInspectionQueue, DefaultInspectionQueue>(); componentContainer.Register <IHttpContextAccessor, HttpContextAccessor>(); componentContainer.Register <IDatabaseContextCache, ContextDatabaseContextCache>(); componentContainer.Register <IHashingService, HashingService>(); componentContainer.RegisterInstance(app.ApplicationServices.GetService <IAccessConfiguration>()); componentContainer.RegisterInstance(app.ApplicationServices.GetService <ISentinelConfiguration>()); var applicationPartManager = app.ApplicationServices.GetRequiredService <ApplicationPartManager>(); var controllerFeature = new ControllerFeature(); applicationPartManager.PopulateFeature(controllerFeature); foreach (var type in controllerFeature.Controllers.Select(t => t.AsType())) { componentContainer.Register(type, type); } ServiceBus.Register(componentContainer); componentContainer.Resolve <IDataStoreDatabaseContextFactory>().ConfigureWith("Sentinel"); componentContainer.Resolve <IDatabaseContextFactory>().ConfigureWith("Sentinel"); _bus = ServiceBus.Create(componentContainer).Start(); applicationLifetime.ApplicationStopping.Register(OnShutdown); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseCors( options => options.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader() ); app.UseMvc(); }
public void Start() { Log.Assign(new Log4NetLog(LogManager.GetLogger(typeof(Host)))); _container = new WindsorContainer(); var container = new WindsorComponentContainer(_container); container.RegisterSuffixed("Shuttle.Sentinel"); EventStore.Register(container); ServiceBus.Register(container); container.Resolve <IDataStoreDatabaseContextFactory>().ConfigureWith("Sentinel"); container.Resolve <IDatabaseContextFactory>().ConfigureWith("Sentinel"); _bus = ServiceBus.Create(container).Start(); var ipv4Address = "0.0.0.0"; foreach (var ip in Dns.GetHostEntry(Dns.GetHostName()).AddressList) { if (ip.AddressFamily != AddressFamily.InterNetwork) { continue; } ipv4Address = ip.ToString(); } //var serviceBusConfiguration = container.Resolve<IServiceBusConfiguration>(); //if (!serviceBusConfiguration.HasInbox) //{ // throw new //} //_bus.Send(new RegisterServerCommand //{ // MachineName = Environment.MachineName, // IPv4Address = ipv4Address, // BaseDirectory = AppDomain.CurrentDomain.BaseDirectory, //}, c => c.Local()); //_bus.Send(new RegisterSystemMetricsCommand(), c => c.Local().Defer(DateTime.Now.AddSeconds(5))); }
public void Start() { Log.Assign(new Log4NetLog(LogManager.GetLogger(typeof(Host)))); _container = new WindsorContainer(); var container = new WindsorComponentContainer(_container); container.RegisterSuffixed("Shuttle.Access.Sql"); EventStore.Register(container); ServiceBus.Register(container); container.Resolve <IDatabaseContextFactory>().ConfigureWith("Access"); _bus = ServiceBus.Create(container).Start(); }
public IServiceProvider ConfigureServices(IServiceCollection services) { services.AddMvc(); services.AddCors(); var container = new WindsorContainer(); var componentContainer = new WindsorComponentContainer(container); componentContainer.RegisterSuffixed("Shuttle.ProcessManagement"); componentContainer.Register <IOrderProcessService, OrderProcessService>(); ServiceBus.Register(componentContainer); _bus = ServiceBus.Create(componentContainer).Start(); return(WindsorRegistrationHelper.CreateServiceProvider(container, services)); }
public IServiceProvider ConfigureServices(IServiceCollection services) { services.AddMvc(); services.AddCors(); var windsorContainer = new WindsorContainer(); var container = new WindsorComponentContainer(windsorContainer); container.RegisterSuffixed("Shuttle.ProcessManagement"); container.Register <IOrderProcessService, OrderProcessService>(); container.Register <IAzureStorageConfiguration, DefaultAzureStorageConfiguration>(); container.RegisterServiceBus(); _bus = container.Resolve <IServiceBus>().Start(); return(WindsorRegistrationHelper.CreateServiceProvider(windsorContainer, services)); }
private static void Main(string[] args) { var container = new WindsorComponentContainer(new WindsorContainer()); ServiceBus.Register(container); using (var bus = ServiceBus.Create(container).Start()) { string userName; while (!string.IsNullOrEmpty(userName = Console.ReadLine())) { bus.Send(new RegisterMemberCommand { UserName = userName }, c => c.WillExpire(DateTime.Now.AddSeconds(5))); } } }
public void Should_be_able_to_perform_full_processing(bool isTransactionalEndpoint, bool enqueueUniqueMessages) { DbProviderFactories.RegisterFactory("System.Data.SqlClient", SqlClientFactory.Instance); var container = new WindsorComponentContainer(new WindsorContainer()); container.RegisterInstance <IIdempotenceConfiguration>(new IdempotenceConfiguration { ProviderName = "System.Data.SqlClient", ConnectionString = "server=.;database=shuttle;user id=sa;password=Pass!000" }); container.Register <IConnectionConfigurationProvider, ConnectionConfigurationProvider>(); container.RegisterSqlQueue(); container.RegisterIdempotence(); container.RegisterDataAccess(); TestIdempotenceProcessing(new ComponentContainer(container, () => container), @"sql://shuttle/{0}", isTransactionalEndpoint, enqueueUniqueMessages); }
public void Start() { Log.Assign(new Log4NetLog(LogManager.GetLogger(typeof(Host)))); _container = new WindsorContainer(); var container = new WindsorComponentContainer(_container); container.RegisterSuffixed(Assembly.GetExecutingAssembly()); ServiceBus.Register(container); var subscriptionManager = container.Resolve <ISubscriptionManager>(); subscriptionManager.Subscribe <OrderCreatedEvent>(); subscriptionManager.Subscribe <InvoiceCreatedEvent>(); subscriptionManager.Subscribe <EMailSentEvent>(); _bus = ServiceBus.Create(container).Start(); }
private static void Main(string[] args) { var container = new WindsorComponentContainer(new WindsorContainer()); container.Register <IAzureStorageConfiguration, DefaultAzureStorageConfiguration>(); container.RegisterServiceBus(); using (var bus = container.Resolve <IServiceBus>().Start()) { string userName; while (!string.IsNullOrEmpty(userName = Console.ReadLine())) { bus.Send(new RegisterMemberCommand { UserName = userName }, c => c.WillExpire(DateTime.Now.AddSeconds(5))); } } }
public void Start() { Log.Assign(new Log4NetLog(LogManager.GetLogger(typeof(Host)))); _container = new WindsorContainer(); var container = new WindsorComponentContainer(_container); container.RegisterSuffixed(Assembly.GetExecutingAssembly()); container.Register <IAzureStorageConfiguration, DefaultAzureStorageConfiguration>(); container.RegisterDataAccess(); container.RegisterSubscription(); container.RegisterServiceBus(); var subscriptionManager = container.Resolve <ISubscriptionManager>(); subscriptionManager.Subscribe <OrderCreatedEvent>(); subscriptionManager.Subscribe <InvoiceCreatedEvent>(); subscriptionManager.Subscribe <EMailSentEvent>(); _bus = container.Resolve <IServiceBus>().Start(); }
public void Should_be_able_to_handle_expired_message() { var handlerInvoker = new FakeMessageHandlerInvoker(); var fakeQueue = new FakeQueue(2); var configuration = new ServiceBusConfiguration { Inbox = new InboxQueueConfiguration { WorkQueue = fakeQueue, ErrorQueue = fakeQueue, ThreadCount = 1 } }; var container = new WindsorComponentContainer(new WindsorContainer()); container.Register <IMessageHandlerInvoker>(handlerInvoker); ServiceBus.Register(container, configuration); using (var bus = ServiceBus.Create(container)) { bus.Start(); var timeout = DateTime.Now.AddMilliseconds(1000); while (fakeQueue.MessageCount < 2 && DateTime.Now < timeout) { Thread.Sleep(5); } } Assert.AreEqual(1, handlerInvoker.GetInvokeCount("SimpleCommand"), "FakeHandlerInvoker was not invoked exactly once."); Assert.AreEqual(2, fakeQueue.MessageCount, "FakeQueue was not invoked exactly twice."); }
private static void Main(string[] args) { try { var arguments = new Arguments(args); if (ShouldShowHelp(arguments)) { ShowHelp(); return; } var destinationQueueUri = GetArgument(arguments, "destination", "d", "Enter the destination queue uri"); var messageType = GetArgument(arguments, "messageType", "mt", "Enter the full type name of the message"); var path = arguments.Get("path", arguments.Get("p", "message.esb")); if (!File.Exists(path)) { ColoredConsole.WriteLine(ConsoleColor.Red, $"File '{path}' could not be found."); return; } if (!arguments.Contains("quiet") && !arguments.Contains("q")) { Console.WriteLine(); Console.WriteLine(); ColoredConsole.WriteLine(ConsoleColor.Red, "About to enqueue message..."); Console.WriteLine(); ColoredConsole.WriteLine(ConsoleColor.Gray, "Message type:"); ColoredConsole.WriteLine(ConsoleColor.White, $" {messageType}"); ColoredConsole.WriteLine(ConsoleColor.Gray, "Destination queue uri:"); ColoredConsole.WriteLine(ConsoleColor.White, $" {destinationQueueUri}"); ColoredConsole.WriteLine(ConsoleColor.Gray, "Message file path:"); ColoredConsole.WriteLine(ConsoleColor.White, $" {path}"); Console.WriteLine(); ColoredConsole.WriteLine(ConsoleColor.Yellow, "Are you sure that you want to continue? [Y]es or [N]o (default is No)"); Console.WriteLine(); var answer = Console.ReadKey(); Console.WriteLine(); Console.WriteLine(); if (!answer.KeyChar.ToString().Equals("Y", StringComparison.InvariantCultureIgnoreCase)) { ColoredConsole.WriteLine(ConsoleColor.Cyan, "No message enqueued."); return; } } var container = new WindsorComponentContainer(new WindsorContainer()); ServiceBus.Register(container); var queueManager = container.Resolve <IQueueManager>(); var transportMessageFactory = container.Resolve <ITransportMessageFactory>(); var serializer = container.Resolve <ISerializer>(); using (ServiceBus.Create(container).Start()) { var destinationQueue = queueManager.CreateQueue(destinationQueueUri); var transportMessage = transportMessageFactory.Create(new object(), c => c.WithRecipient(destinationQueue)); transportMessage.AssemblyQualifiedName = messageType; transportMessage.MessageType = messageType; transportMessage.Message = Encoding.UTF8.GetBytes(File.ReadAllText(path)); using (var stream = serializer.Serialize(transportMessage)) { destinationQueue.Enqueue(transportMessage, stream); } destinationQueue.AttemptDispose(); } queueManager.AttemptDispose(); ColoredConsole.WriteLine(ConsoleColor.Cyan, "Message enqueued."); } catch (Exception ex) { ColoredConsole.WriteLine(ConsoleColor.Red, ex.AllMessages()); } }
private static void Main(string[] args) { try { var arguments = new Arguments(args); if (ShouldShowHelp(arguments)) { ShowHelp(); return; } var sourceQueueUri = GetQueueUri(arguments, "source"); var destinationQueueUri = GetQueueUri(arguments, "destination"); if (sourceQueueUri.Equals(destinationQueueUri)) { throw new ArgumentException("Source queue uri cannot be the same as the destination queue uri."); } var maximumCount = arguments.Get("count", arguments.Get("c", 0)); var clear = arguments.Contains("clear"); var copy = arguments.Contains("copy"); if (maximumCount == 0) { maximumCount = 30; } if (!arguments.Contains("quiet") && !arguments.Contains("q")) { Console.WriteLine(); Console.WriteLine(); ColoredConsole.WriteLine(ConsoleColor.Red, $"About to {(copy ? "copy" : "transfer")} {maximumCount} message{(maximumCount == 1 ? string.Empty : "s")}..."); Console.WriteLine(); ColoredConsole.WriteLine(ConsoleColor.Gray, "Source queue uri:"); ColoredConsole.WriteLine(ConsoleColor.White, $" {sourceQueueUri}"); ColoredConsole.WriteLine(ConsoleColor.Gray, "Destination queue uri:"); ColoredConsole.WriteLine(ConsoleColor.White, $" {destinationQueueUri}"); Console.WriteLine(); ColoredConsole.WriteLine(ConsoleColor.Yellow, "Are you sure that you want to continue? [Y]es or [N]o (default is No)"); Console.WriteLine(); var answer = Console.ReadKey(); Console.WriteLine(); Console.WriteLine(); if (!answer.KeyChar.ToString().Equals("Y", StringComparison.InvariantCultureIgnoreCase)) { ColoredConsole.WriteLine(ConsoleColor.Cyan, "No messages transferred."); return; } } ColoredConsole.WriteLine(ConsoleColor.DarkCyan, "[starting]"); var container = new WindsorComponentContainer(new WindsorContainer()); ServiceBus.Register(container); var transferCount = 0; var skipCount = 0; var processedWording = (copy ? "Copied" : "Transferred"); var queueManager = container.Resolve <IQueueManager>(); var serializer = container.Resolve <ISerializer>(); var messageIds = new HashSet <Guid>(); using (ServiceBus.Create(container).Start()) { var sourceQueue = queueManager.CreateQueue(sourceQueueUri); var destinationQueue = queueManager.CreateQueue(destinationQueueUri); var receivedMessage = sourceQueue.GetMessage(); while (receivedMessage != null) { var stream = receivedMessage.Stream; var transportMessage = (TransportMessage)serializer.Deserialize(TransportMessageType, stream); if (clear) { transportMessage.FailureMessages.Clear(); stream.Dispose(); stream = serializer.Serialize(transportMessage); } if (!messageIds.Contains(transportMessage.MessageId)) { destinationQueue.Enqueue(transportMessage, stream); messageIds.Add(transportMessage.MessageId); } else { skipCount++; } if (!copy) { sourceQueue.Acknowledge(receivedMessage.AcknowledgementToken); } else { sourceQueue.Release(receivedMessage.AcknowledgementToken); } transferCount++; if (transferCount != maximumCount) { receivedMessage = sourceQueue.GetMessage(); if (transferCount % 100 == 0) { ColoredConsole.WriteLine(ConsoleColor.DarkCyan, $"{processedWording} {transferCount} messages so far..."); } } else { receivedMessage = null; } } sourceQueue.AttemptDispose(); destinationQueue.AttemptDispose(); } queueManager.AttemptDispose(); ColoredConsole.WriteLine(ConsoleColor.Cyan, $"{processedWording} {transferCount} messages in total."); if (skipCount > 0) { ColoredConsole.WriteLine(ConsoleColor.DarkCyan, $"Skipped {skipCount} duplicate messages."); } } catch (Exception ex) { ColoredConsole.WriteLine(ConsoleColor.Red, ex.AllMessages()); } }
private static void Main(string[] args) { try { var arguments = new Arguments(args); if (ShouldShowHelp(arguments)) { ShowHelp(); return; } var queueUri = GetQueueUri(arguments, "source"); var folder = Path.GetFullPath(arguments.Get("folder", arguments.Get("f", ".\\messages"))); var maximumCount = int.Parse(arguments.Get("count", arguments.Get("c", "30"))); if (!arguments.Contains("quiet") && !arguments.Contains("q")) { Console.WriteLine(); Console.WriteLine(); ColoredConsole.WriteLine(ConsoleColor.Red, "About to dump {0} message{1}...", maximumCount, maximumCount == 1 ? string.Empty : "s"); Console.WriteLine(); ColoredConsole.WriteLine(ConsoleColor.Gray, "Queue uri:"); ColoredConsole.WriteLine(ConsoleColor.White, " {0}", queueUri); ColoredConsole.WriteLine(ConsoleColor.Gray, "Folder:"); ColoredConsole.WriteLine(ConsoleColor.White, " {0}", folder); Console.WriteLine(); ColoredConsole.WriteLine(ConsoleColor.Yellow, "Are you sure that you want to continue? [Y]es or [N]o (default is No)"); Console.WriteLine(); var answer = Console.ReadKey(); Console.WriteLine(); Console.WriteLine(); if (!answer.KeyChar.ToString().Equals("Y", StringComparison.InvariantCultureIgnoreCase)) { ColoredConsole.WriteLine(ConsoleColor.Cyan, "No messages dumped."); return; } } ColoredConsole.WriteLine(ConsoleColor.DarkCyan, "[starting]"); var container = new WindsorComponentContainer(new WindsorContainer()); ServiceBus.Register(container); var count = 0; var queueManager = container.Resolve <IQueueManager>(); var serializer = container.Resolve <ISerializer>(); using (ServiceBus.Create(container).Start()) { var queue = queueManager.CreateQueue(queueUri); if (!Directory.Exists(folder)) { Directory.CreateDirectory(folder); } var receivedMessage = queue.GetMessage(); while (receivedMessage != null) { queue.Release(receivedMessage.AcknowledgementToken); var stream = receivedMessage.Stream; var transportMessage = (TransportMessage)serializer.Deserialize(TransportMessageType, stream); var document = new XmlDocument(); document.Load(stream); var root = document.GetElementsByTagName("TransportMessage")[0]; var message = root.SelectSingleNode("Message"); if (message != null) { message.InnerXml = Encoding.UTF8.GetString(transportMessage.Message); } Dump(document, Path.Combine(folder, string.Concat(transportMessage.MessageId.ToString("n"), ".xml"))); count++; if (count != maximumCount) { receivedMessage = queue.GetMessage(); if (count % 100 == 0) { ColoredConsole.WriteLine(ConsoleColor.DarkCyan, "Dumped {0} messages so far...", count); } } else { receivedMessage = null; } } queue.AttemptDispose(); ColoredConsole.WriteLine(ConsoleColor.Cyan, "Dumped {0} messages in total.", count); } queueManager.AttemptDispose(); } catch (Exception ex) { ColoredConsole.WriteLine(ConsoleColor.Red, ex.AllMessages()); } }
public static ComponentContainer GetComponentContainer() { var container = new WindsorComponentContainer(new WindsorContainer()); return(new ComponentContainer(container, () => container)); }