protected override void SetUp() { MsmqUtil.Delete(InputQueueName); _handlerActivator = new BuiltinHandlerActivator(); _bus = Configure.With(_handlerActivator) .Logging(l => l.Console()) .Transport(t => { t.UseMsmq(InputQueueName) .OnCreated(queue => { queue.ResetPermissions(); var user = new SecurityIdentifier(WellKnownSidType.WorldSid, null) .Translate(typeof(NTAccount)) .ToString(); queue.SetPermissions(user, MessageQueueAccessRights.FullControl); }); }) .Routing(r => r.TypeBased().Map<string>(InputQueueName)) .Options(o => o.SetNumberOfWorkers(1)) .Start(); Using(_bus); }
protected override void DoTearDown() { disposables.ForEach(d => d.Dispose()); MsmqUtil.Delete(AzureReceiverInputQueueName); MsmqUtil.Delete(MsmqSenderInputQueueName); }
protected override void DoTearDown() { timeoutService.Stop(); MsmqUtil.Delete(SagaBusInputQueueName); MsmqUtil.Delete(ServiceBusInputQueueName); }
protected override void DoTearDown() { CleanUpTrackedDisposables(); MsmqUtil.Delete(AzureReceiverInputQueueName); MsmqUtil.Delete(MsmqSenderInputQueueName); }
protected override void DoTearDown() { Console.WriteLine("Tearing down the service"); service.Stop(); MsmqUtil.Delete(DestinationQueueName); }
protected override void DoTearDown() { CleanUpTrackedDisposables(); MsmqUtil.Delete(InputQueueName); MsmqUtil.Delete(ErrorQueueName); base.DoTearDown(); }
static void DeleteQueueIfExists() { if (MessageQueue.Exists(MsmqUtil.GetPath(QueueName))) { MsmqUtil.Delete(QueueName); } }
protected override IDuplexTransport CreateTransport(string inputQueueName) { RegisterForDisposal(new DisposableAction(() => MsmqUtil.Delete(inputQueueName))); RegisterForDisposal(new DisposableAction(() => MsmqUtil.Delete(ErrorQueueName))); MsmqUtil.EnsureMessageQueueExists(MsmqUtil.GetPath(ErrorQueueName)); return(new MsmqMessageQueue(inputQueueName).PurgeInputQueue()); }
protected override void DoTearDown() { stuffToDispose.ForEach(d => d.Dispose()); MsmqUtil.Delete(SenderQueueName); MsmqUtil.Delete(ReceiverQueueName); MsmqUtil.Delete(ErrorQueueName); }
protected override void DoTearDown() { CleanUpTrackedDisposables(); MsmqUtil.Delete(SenderQueueName); MsmqUtil.Delete(ReceiverQueueName); MsmqUtil.Delete(ErrorQueueName); }
protected override void SetUp() { MsmqUtil.Delete(_inputQueueName); Configure.With(Using(new BuiltinHandlerActivator())) .Transport(t => t.UseMsmq(_inputQueueName)) .Start(); }
protected override void DoSetUp() { MsmqUtil.Delete(DestinationQueueName); Console.WriteLine("Creating new service"); service = new InboundService(ListenUri, DestinationQueueName); service.Start(); }
protected override void DoSetUp() { MsmqUtil.Delete(SenderInputQueueName); MsmqUtil.Delete(ReceiverInputQueueName); MsmqUtil.Delete(ErrorQueueName); MsmqUtil.EnsureMessageQueueExists(MsmqUtil.GetPath(ErrorQueueName)); }
static void DeleteQueue(string queueName) { if (!MsmqUtil.QueueExists(queueName)) { return; } MsmqUtil.Delete(queueName); }
protected override void DoTearDown() { gatewayInDmz.Stop(); gatewayInside.Stop(); MsmqUtil.Delete(PriceDeskInputQueue); MsmqUtil.Delete(OrderSystemInputQueue); MsmqUtil.Delete(GatewayListeningQueue); }
public void CleanUp() { _disposables.ForEach(d => d.Dispose()); _disposables.Clear(); foreach (var queue in _queuesToDelete) { MsmqUtil.Delete(queue); } _queuesToDelete.Clear(); }
public void TearDown() { try { DoTearDown(); } finally { toDispose.ForEach(b => b.Dispose()); } MsmqUtil.Delete(ErrorQueueName); }
protected override void SetUp() { MsmqUtil.Delete(_inputQueueName); Configure.With(Using(new BuiltinHandlerActivator())) .Transport(t => t.UseMsmq(_inputQueueName)) .Options(opt => { opt.Decorate <IMsmqHeaderSerializer>(p => new MangledMessageIngoreSerializer()); }) .Serialization(c => c.Register(_ => new StaticMessageDeserializer())) .Start(); }
protected override void SetUp() { var queueName = TestConfig.QueueName("expressperf"); MsmqUtil.Delete(queueName); _activator = Using(new BuiltinHandlerActivator()); _bus = Configure.With(_activator) .Logging(l => l.ColoredConsole(LogLevel.Info)) .Transport(t => t.UseMsmq(queueName)) .Options(o => o.SetMaxParallelism(100)) .Start(); }
protected override void DoTearDown() { var queuesToDelete = new[] { InputQueue, ErrorQueue, AuditQueue }.Where(MsmqUtil.QueueExists); foreach (var queue in queuesToDelete) { MsmqUtil.Delete(queue); } }
public IBus GetBus <TMessage>(string inputQueueAddress, Func <TMessage, Task> handler) { var queueName = TestConfig.GetName(inputQueueAddress); MsmqUtil.Delete(queueName); var builtinHandlerActivator = new BuiltinHandlerActivator(); builtinHandlerActivator.Handle(handler); var bus = Configure.With(builtinHandlerActivator) .Transport(t => t.UseMsmq(queueName)) .Options(o => o.SetNumberOfWorkers(10)) .Start(); _stuffToDispose.Add(bus); return(bus); }
protected override void DoSetUp() { MsmqUtil.Delete(SagaBusInputQueueName); MsmqUtil.Delete(ServiceBusInputQueueName); // this is the bus hosting the saga sagaHandlerActivator = new HandlerActivatorForTesting(); sagaPersister = new InMemorySagaPersister(); sagaBus = CreateBus(SagaBusInputQueueName, sagaHandlerActivator, new InMemorySubscriptionStorage(), sagaPersister, "error").Start(1); // this is the "service bus", i.e. just some request/reply-enabled service somewhere serviceHandlerActivator = new HandlerActivatorForTesting(); serviceBus = CreateBus(ServiceBusInputQueueName, serviceHandlerActivator).Start(1); // this is just a bus from the outside that can initiate everything initiatorBus = CreateBus("test.autocorrelation.initiator", new HandlerActivatorForTesting()).Start(1); timeoutService = new TimeoutService(new InMemoryTimeoutStorage()); timeoutService.Start(); }
protected override void DoSetUp() { RebusLoggerFactory.Current = new ConsoleLoggerFactory(false) { MinLevel = LogLevel.Warn }; MsmqUtil.Delete(PriceDeskInputQueue); MsmqUtil.Delete(OrderSystemInputQueue); MsmqUtil.Delete(GatewayListeningQueue); // this one is in DMZ pricedesk = CreateBus(PriceDeskInputQueue, new HandlerActivatorForTesting()); // and this one is inside orderSystemHandlerActivator = new HandlerActivatorForTesting(); ordersystem = CreateBus(OrderSystemInputQueue, orderSystemHandlerActivator); // so we set up a one-way gateway service on each side: gatewayInDmz = new GatewayService { ListenQueue = GatewayListeningQueue, DestinationUri = "http://localhost:18080", }; gatewayInside = new GatewayService { ListenUri = "http://+:18080", DestinationQueue = OrderSystemInputQueue }; gatewayInDmz.Start(); gatewayInside.Start(); pricedesk.Start(1); ordersystem.Start(1); }
public void CanInjectMessageContext() { // since the built-in container adapter does not support ctor injection, we can't test this if (typeof(TFactory) == typeof(BuiltinContainerAdapterFactory)) { return; } SomeHandler.Reset(); factory.Register <IHandleMessages <string>, SomeHandler>(); try { using (var bus = Configure.With(adapter) .Logging(l => l.ColoredConsole(LogLevel.Warn)) .Transport(t => t.UseMsmq("test.containeradapter.input", "error")) .CreateBus() .Start()) { bus.SendLocal("hello there!"); var timeout = 5.Seconds(); if (!SomeHandler.WaitieThingie.WaitOne(timeout)) { Assert.Fail("Did not receive message within {0} timeout", timeout); } SomeHandler.HadContext.ShouldBe(true); } } finally { MsmqUtil.Delete("test.containeradapter.input"); } }
protected override void DoSetUp() { MsmqUtil.Delete(SenderInputQueueName); MsmqUtil.Delete(ReceiverInputQueueName); }
protected override void DoTearDown() { MsmqUtil.Delete(InputQueueName); }
protected override void DoSetUp() { MsmqUtil.Delete(InputQueueName); }
protected override void TearDown() { MsmqUtil.Delete(_queueName); MsmqUtil.Delete(_queueNameTimeoutManager); }
protected override void DoTearDown() { MsmqUtil.Delete(SenderInputQueueName); MsmqUtil.Delete(ReceiverInputQueueName); MsmqUtil.Delete(ErrorQueueName); }