public void Write() { BusConfiguration config = new BusConfiguration(); config.EndpointName(endpointName); IEnumerable <Type> typesToScan = TypeScanner.NestedTypes <HeaderWriterError>(typeof(ConfigErrorQueue)); config.TypesToScan(typesToScan); config.EnableInstallers(); config.UsePersistence <InMemoryPersistence>(); config.RegisterComponents(c => c.ConfigureComponent <Mutator>(DependencyLifecycle.InstancePerCall)); using (UnicastBus bus = (UnicastBus)Bus.Create(config).Start()) { bus.Builder.Build <BusNotifications>() .Errors .MessageSentToErrorQueue .Subscribe(e => { string headerText = HeaderWriter.ToFriendlyString <HeaderWriterError>(e.Headers); headerText = BehaviorCleaner.CleanStackTrace(headerText); headerText = StackTraceCleaner.CleanStackTrace(headerText); SnippetLogger.Write(text: headerText, suffix: "Error"); ManualResetEvent.Set(); }); bus.SendLocal(new MessageToSend()); ManualResetEvent.WaitOne(); } }
void Shutdown(IBus bus) { #region Hosting-Shutdown UnicastBus busImpl = (UnicastBus)bus; busImpl.Dispose(); #endregion }
void InternalTransportTransportMessageReceived(object sender, TransportMessageReceivedEventArgs e) { if (UnicastBus.HandledSubscriptionMessage(e.Message, Subscribers, null)) { e.Message.ReplyToAddress = ExternalAddress; ExternalMessageSender.Send(e.Message, remoteServer); Logger.Debug("Received subscription message."); return; } var data = new ProxyData { Id = GenerateId(), ClientAddress = e.Message.ReplyToAddress, CorrelationId = e.Message.IdForCorrelation }; Storage.Save(data); Logger.Debug("Forwarding request to " + remoteServer + "."); e.Message.IdForCorrelation = data.Id; e.Message.ReplyToAddress = ExternalAddress; ExternalMessageSender.Send(e.Message, remoteServer); return; }
private static void Main(string[] args) { if (args.Length == 0) { Console.WriteLine( "Please specify two parameters. First : SubscriptionStorage queue full path. Second : Plugin queue full path."); return; } var subscriptionStorageQueue = args[0]; string pluginInputQueue; if (args.Length == 1) { pluginInputQueue = LoadPluginQueueFromConfigFile(); if (pluginInputQueue == null) { return; } } else { pluginInputQueue = args[1]; } DeletePluginQueue(pluginInputQueue); DeletePluginQueue(UnicastBus.GetUiQueueName(pluginInputQueue)); ClearSubscriptionStorage(subscriptionStorageQueue, pluginInputQueue); }
public EventPublisher(UnicastBus bus) { this.bus = bus; timer = new Timer(5000) {AutoReset = true}; timer.Elapsed += TimerElapse; timer.Start(); }
public HostIdFixer(UnicastBus bus) { Guid hostId = CreateGuid(Environment.MachineName, Configure.EndpointName); string identifier = Assembly.GetExecutingAssembly().Location; bus.HostInformation = new HostInformation(hostId, Environment.MachineName, identifier); }
protected override void ConfigureContainer() { base.ConfigureContainer(); var eventAggregator = this.Container.Resolve<IEventAggregator>(); var q = ConfigurationManager.AppSettings["OverrideEndpointName"]; // Initialize the bus Bus = (UnicastBus)NServiceBus.Configure.With() .DefineEndpointName(q) .DefaultBuilder() .XmlSerializer() .MsmqTransport() .IsTransactional(true) .PurgeOnStartup(false) .RunCustomAction(() => Configure.Instance.Configurer.RegisterSingleton<IEventAggregator>(eventAggregator)) .UnicastBus() .ImpersonateSender(false) .LoadMessageHandlers() .PurgeOnStartup(true) .CreateBus() .Start(); this.RegisterTypeIfMissing(typeof(IBus), typeof(UnicastBus), true); this.Container.RegisterInstance<IBus>(Bus); // Register Raven as the IQuery for error persistence DocumentStore documentStore = new DocumentStore { ConnectionStringName = "RavenDbConnectionString" }; documentStore.Initialize(); ravenStore.DocumentStore = documentStore; this.RegisterTypeIfMissing(typeof(IQueryErrorPersistence), typeof(QueryFromRavenDB), true); this.Container.RegisterInstance<IQueryErrorPersistence>(ravenStore); }
public void Shutdown() { IBus bus = null; #region Hosting-Shutdown UnicastBus busImpl = (UnicastBus)bus; busImpl.Dispose(); #endregion }
public EventPublisher(UnicastBus bus) { this.bus = bus; timer = new Timer(5000) { AutoReset = true }; timer.Elapsed += TimerElapse; timer.Start(); }
public HostIdFixer(UnicastBus bus, ReadOnlySettings settings) { Guid hostId = CreateGuid(Environment.MachineName, settings.EndpointName()); string location = Assembly.GetExecutingAssembly().Location; Dictionary<string, string> properties = new Dictionary<string, string> { {"Location", location} }; bus.HostInformation = new HostInformation(hostId, Environment.MachineName, properties); }
public TimerBasedPeriodicCheck(IPeriodicCheck periodicCheck, ISendMessages messageSender, Configure configure, UnicastBus unicastBus, CriticalError criticalError) { this.periodicCheck = periodicCheck; this.configure = configure; this.unicastBus = unicastBus; serviceControlBackend = new ServiceControlBackend(messageSender, configure, criticalError); timer = new Timer(Run, null, TimeSpan.Zero, periodicCheck.Interval); }
void ReadTuning(UnicastBus unicastBus) { #region ReadTuning var transport = unicastBus.Transport; var messageThroughputPerSecond = transport.MaximumMessageThroughputPerSecond; var maximumConcurrencyLevel = transport.MaximumConcurrencyLevel; #endregion }
void ChangeTuning(UnicastBus unicastBus) { #region ChangeTuning var transport = unicastBus.Transport; transport.ChangeMaximumMessageThroughputPerSecond(10); transport.ChangeMaximumConcurrencyLevel(5); #endregion }
public void SetUp() { transport = MockRepository.GenerateStub <ITransport>(); bus = new UnicastBus { Transport = transport, MessageSerializer = MockRepository.GenerateStub <IMessageSerializer>() }; }
public HostIdFixer(UnicastBus bus) { var hostId = CreateGuid(Environment.MachineName, Configure.EndpointName); var identifier = Assembly.GetExecutingAssembly().Location; bus.HostInformation = new HostInformation( hostId: hostId, displayName: Environment.MachineName, displayInstanceIdentifier: identifier); }
private void MapTransportMessageFor(UnicastBus bus, object[] rawMessages, TransportMessage result) { result.ReplyToAddress = Address.Local; object[] messages = rawMessages; var memoryStream = new MemoryStream(); _messageSerializer.Serialize(messages, memoryStream); result.Body = memoryStream.ToArray(); result.ReplyToAddress = Address.Local; result.TimeToBeReceived = TimeSpan.MaxValue; }
public HostIdFixer(UnicastBus bus, ReadOnlySettings settings) { var hostId = CreateGuid(Environment.MachineName, settings.EndpointName()); var location = Assembly.GetExecutingAssembly().Location; var properties = new Dictionary <string, string> { { "Location", location } }; bus.HostInformation = new HostInformation(hostId, Environment.MachineName, properties); }
Usage(UnicastBus unicastBus) { #region ChangeTuning unicastBus.Transport.ChangeMaximumMessageThroughputPerSecond(10); unicastBus.Transport.ChangeMaximumConcurrencyLevel(5); #endregion #region ReadTuning int messageThroughputPerSecond = unicastBus.Transport.MaximumMessageThroughputPerSecond; int maximumConcurrencyLevel = unicastBus.Transport.MaximumConcurrencyLevel; #endregion }
Usage(UnicastBus unicastBus) { #region ChangeTuning unicastBus.Transport.ChangeMaximumMessageThroughputPerSecond(10); unicastBus.Transport.ChangeMaximumConcurrencyLevel(5); #endregion #region ReadTuning int messageThroughputPerSecond = unicastBus.Transport.MaximumMessageThroughputPerSecond; int maximumConcurrencyLevel = unicastBus.Transport.MaximumConcurrencyLevel; #endregion }
public void SetUp() { Configure.GetEndpointNameAction = () => "TestEndpoint"; const string localAddress = "endpointA"; MasterNodeAddress = new Address(localAddress, "MasterNode"); try { Address.InitializeLocalAddress(localAddress); } catch // intentional { } MessageSerializer = new XmlMessageSerializer(MessageMapper); ExtensionMethods.GetStaticOutgoingHeadersAction = () => MessageHeaderManager.staticHeaders; gatewayAddress = MasterNodeAddress.SubScope("gateway"); messageSender = MockRepository.GenerateStub <ISendMessages>(); subscriptionStorage = new FakeSubscriptionStorage(); FuncBuilder.Register <IMutateOutgoingTransportMessages>(() => headerManager); FuncBuilder.Register <IMutateOutgoingTransportMessages>(() => new SentTimeMutator()); FuncBuilder.Register <DefaultDispatcherFactory>(() => new DefaultDispatcherFactory()); FuncBuilder.Register <EstimatedTimeToSLABreachCalculator>(() => SLABreachCalculator); unicastBus = new UnicastBus { MasterNodeAddress = MasterNodeAddress, TimeoutManagerAddress = MasterNodeAddress.SubScope("Timeouts"), MessageSerializer = MessageSerializer, Builder = FuncBuilder, MessageSender = messageSender, Transport = Transport, SubscriptionStorage = subscriptionStorage, AutoSubscribe = true, MessageMapper = MessageMapper, FailureManager = MockRepository.GenerateStub <IManageMessageFailures>() }; bus = unicastBus; FuncBuilder.Register <IMutateOutgoingTransportMessages>(() => new RelatedToMessageMutator { Bus = bus }); FuncBuilder.Register <IBus>(() => bus); ExtensionMethods.SetHeaderAction = headerManager.SetHeader; }
private static void RegisterAssemblyDomainEventSubscriptionMappings(DomainEventBusConfig domainEventBusConfig, IEnumerable<Type> domainEventTypes, ICollection<Type> domainEventMessageTypes, UnicastBus bus) { var domainEventMessageType = typeof(NServiceBusEventMessage<>); foreach (DomainEventEndpointMapping mapping in domainEventBusConfig.DomainEventEndpointMappings) { foreach (var domainEventType in domainEventTypes) { if (DomainEventsIsAssembly(domainEventType, mapping.DomainEvents)) { var messageType = domainEventMessageType.MakeGenericType(domainEventType); domainEventMessageTypes.Add(messageType); bus.RegisterMessageType(messageType, mapping.Endpoint, false); } } } }
private static void RegisterDomainEventSubscriptionMappings(DomainEventBusConfig domainEventBusConfig, IEnumerable<Type> domainEventTypes, ICollection<Type> domainEventMessageTypes, UnicastBus bus) { var domainEventMessageType = typeof(DomainEventMessage<>); foreach (DomainEventEndpointMapping mapping in domainEventBusConfig.DomainEventEndpointMappings) { foreach (var domainEventType in domainEventTypes) { if (DomainEventsIsDomainEvent(domainEventType, mapping.DomainEvents)) { var messageType = domainEventMessageType.MakeGenericType(domainEventType); domainEventMessageTypes.Add(messageType); bus.RegisterMessageType(messageType, new Address(mapping.QueueName, mapping.MachineName)); } } } }
public void Write() { BusConfiguration busConfiguration = new BusConfiguration(); busConfiguration.EndpointName(endpointName); IEnumerable <Type> typesToScan = TypeScanner.NestedTypes <HeaderWriterSaga>(typeof(ConfigErrorQueue)); busConfiguration.TypesToScan(typesToScan); busConfiguration.EnableInstallers(); busConfiguration.UsePersistence <InMemoryPersistence>(); busConfiguration.RegisterComponents(c => c.ConfigureComponent <Mutator>(DependencyLifecycle.InstancePerCall)); using (UnicastBus bus = (UnicastBus)Bus.Create(busConfiguration).Start()) { bus.SendLocal(new StartSaga1Message()); CountdownEvent.Wait(); } }
void ExternalTransportTransportMessageReceived(object sender, TransportMessageReceivedEventArgs e) { if (e.Message.MessageIntent == MessageIntentEnum.Publish) { string val = null; foreach (var header in e.Message.Headers) { if (header.Key == UnicastBus.EnclosedMessageTypes) { val = header.Value; } } var types = UnicastBus.DeserializeEnclosedMessageTypes(val); var subs = Subscribers.GetSubscriberAddressesForMessage(types.Select(s => new MessageType(s))); Logger.Debug("Received notification from " + remoteServer + "."); foreach (var s in subs) { InternalMessageSender.Send(e.Message, s); } } else { ProxyData data = null; if (e.Message.CorrelationId != null) { data = Storage.GetAndRemove(e.Message.CorrelationId); } if (data == null) { return; } e.Message.CorrelationId = data.CorrelationId; Logger.Debug("Received response from " + remoteServer + "."); InternalMessageSender.Send(e.Message, data.ClientAddress); } }
public Usage() { UnicastBus bus = null; #region ChangeThroughput //bus is an instance of NServiceBus.Unicast.UnicastBus bus.Transport.ChangeMaximumMessageThroughputPerSecond(10); bus.Transport.ChangeMaximumConcurrencyLevel(5); #endregion #region ReadThroughput //bus is an instance of NServiceBus.Unicast.UnicastBus int messageThroughputPerSecond = bus.Transport.MaximumMessageThroughputPerSecond; int maximumConcurrencyLevel = bus.Transport.MaximumConcurrencyLevel; #endregion }
public void SetUp() { string localAddress = "endpointA"; Address masterNodeAddress = localAddress + "@MasterNode"; try { Address.InitializeLocalAddress(localAddress); } catch // intentional { } ExtensionMethods.IsMessageTypeAction = t => typeof(IMessage).IsAssignableFrom(t) && t != typeof(IMessage); ExtensionMethods.GetStaticOutgoingHeadersAction = () => MessageHeaderManager.staticHeaders; gatewayAddress = masterNodeAddress.SubScope("gateway"); messageSender = MockRepository.GenerateStub<ISendMessages>(); var masterNodeManager = MockRepository.GenerateStub<IManageTheMasterNode>(); var builder = MockRepository.GenerateStub<IBuilder>(); builder.Stub(x => x.BuildAll<IMutateOutgoingMessages>()).Return(new IMutateOutgoingMessages[] { }); builder.Stub(x => x.BuildAll<IMutateOutgoingTransportMessages>()).Return(new IMutateOutgoingTransportMessages[] { headerManager }); masterNodeManager.Stub(x => x.GetMasterNode()).Return(masterNodeAddress); unicastBus = new UnicastBus { MessageSerializer = MockRepository.GenerateStub<IMessageSerializer>(), Builder = builder, MasterNodeManager = masterNodeManager, MessageSender = messageSender, Transport = MockRepository.GenerateStub<ITransport>() }; bus = unicastBus; ExtensionMethods.SetHeaderAction = headerManager.SetHeader; ((IStartableBus)bus).Start(); }
public SetHostInformation(UnicastBus unicastBus) { this.unicastBus = unicastBus; }
public MessageStuffer(UnicastBus busUsedToSerializeMessages) { _busUsedToSerializeMessages = busUsedToSerializeMessages; _messageSerializer = busUsedToSerializeMessages.Builder.Build <IMessageSerializer>(); }
public IEnumerable <MessageInfo <TMessage> > GetMessageInfos <TMessage>() where TMessage : IMessage { var result = new List <MessageInfo <TMessage> >(); foreach (var transportMessage in this.Where(transportMessage => transportMessage.Destination == _name || transportMessage.Destination == UnicastBus.GetUiQueueName(_name))) { result.AddRange(transportMessage.GetMessages <TMessage>()); } return(result.ToArray()); }
public MainEndpointSettings(TransactionalTransport masterNodeTransport,UnicastBus unicastBus) { this.masterNodeTransport = masterNodeTransport; this.unicastBus = unicastBus; }
public MessagePicker(UnicastBus bus) { _bus = bus; }
private static void RegisterAssemblyDomainEventSubscriptionMappings(DomainEventBusConfig domainEventBusConfig, IEnumerable <Type> domainEventTypes, ICollection <Type> domainEventMessageTypes, UnicastBus bus) { var domainEventMessageType = typeof(DomainEventMessage <>); foreach (DomainEventEndpointMapping mapping in domainEventBusConfig.DomainEventEndpointMappings) { foreach (var domainEventType in domainEventTypes) { if (DomainEventsIsAssembly(domainEventType, mapping.DomainEvents)) { var messageType = domainEventMessageType.MakeGenericType(domainEventType); domainEventMessageTypes.Add(messageType); bus.RegisterMessageType(messageType, new Address(mapping.QueueName, mapping.MachineName)); } } } }
public FinishedProcessingListener(UnicastBus bus, Context context) { this.context = context; bus.Transport.FinishedMessageProcessing += Transport_FinishedMessageProcessing; }
public void SetUp() { LicenseManager.InitializeLicense(); transportDefinition = new MsmqTransport(); settings = new SettingsHolder(); settings.SetDefault("EndpointName", "TestEndpoint"); settings.SetDefault("Endpoint.SendOnly", false); settings.SetDefault("MasterNode.Address", MasterNodeAddress); pipelineModifications = new PipelineModifications(); settings.Set <PipelineModifications>(pipelineModifications); ApplyPipelineModifications(); Transport = new FakeTransport(); FuncBuilder = new FuncBuilder(); FuncBuilder.Register <ReadOnlySettings>(() => settings); router = new StaticMessageRouter(KnownMessageTypes()); var conventions = new Conventions(); handlerRegistry = new MessageHandlerRegistry(conventions); MessageMetadataRegistry = new MessageMetadataRegistry(false, conventions); MessageSerializer = new XmlMessageSerializer(MessageMapper, conventions); messageSender = MockRepository.GenerateStub <ISendMessages>(); subscriptionStorage = new FakeSubscriptionStorage(); configure = new Configure(settings, FuncBuilder, new List <Action <IConfigureComponents> >(), new PipelineSettings(null)) { localAddress = Address.Parse("TestEndpoint") }; subscriptionManager = new SubscriptionManager { MessageSender = messageSender, SubscriptionStorage = subscriptionStorage, Configure = configure }; pipelineFactory = new PipelineExecutor(settings, FuncBuilder); FuncBuilder.Register <IMessageSerializer>(() => MessageSerializer); FuncBuilder.Register <ISendMessages>(() => messageSender); FuncBuilder.Register <LogicalMessageFactory>(() => new LogicalMessageFactory(MessageMetadataRegistry, MessageMapper, pipelineFactory)); FuncBuilder.Register <IManageSubscriptions>(() => subscriptionManager); FuncBuilder.Register <EstimatedTimeToSLABreachCalculator>(() => SLABreachCalculator); FuncBuilder.Register <MessageMetadataRegistry>(() => MessageMetadataRegistry); FuncBuilder.Register <IMessageHandlerRegistry>(() => handlerRegistry); FuncBuilder.Register <IMessageMapper>(() => MessageMapper); FuncBuilder.Register <DeserializeLogicalMessagesBehavior>(() => new DeserializeLogicalMessagesBehavior { MessageSerializer = MessageSerializer, MessageMetadataRegistry = MessageMetadataRegistry, }); FuncBuilder.Register <CreatePhysicalMessageBehavior>(() => new CreatePhysicalMessageBehavior()); FuncBuilder.Register <PipelineExecutor>(() => pipelineFactory); FuncBuilder.Register <TransportDefinition>(() => transportDefinition); var messagePublisher = new StorageDrivenPublisher { MessageSender = messageSender, SubscriptionStorage = subscriptionStorage }; var deferrer = new TimeoutManagerDeferrer { MessageSender = messageSender, TimeoutManagerAddress = MasterNodeAddress.SubScope("Timeouts"), Configure = configure, }; FuncBuilder.Register <IDeferMessages>(() => deferrer); FuncBuilder.Register <IPublishMessages>(() => messagePublisher); bus = new UnicastBus { Builder = FuncBuilder, MessageSender = messageSender, Transport = Transport, MessageMapper = MessageMapper, SubscriptionManager = subscriptionManager, MessageRouter = router, Settings = settings, Configure = configure, HostInformation = new HostInformation(Guid.NewGuid(), "HelloWorld") }; FuncBuilder.Register <IMutateOutgoingTransportMessages>(() => new CausationMutator { Bus = bus }); FuncBuilder.Register <IBus>(() => bus); FuncBuilder.Register <UnicastBus>(() => bus); FuncBuilder.Register <Conventions>(() => conventions); FuncBuilder.Register <Configure>(() => configure); }
public MessagePicker(UnicastBus bus) { _bus = bus; _serializer = _bus.Builder.Build <IMessageSerializer>(); }
public AuditInspector(UnicastBus bus) { this.bus = bus; }
public MainEndpointSettings(TransactionalTransport masterNodeTransport, UnicastBus unicastBus) { this.masterNodeTransport = masterNodeTransport; this.unicastBus = unicastBus; }
public void PopulateUiQueueFromFullQueueName() { UnicastBus.GetUiQueueName("input@truhtanov").Should(Be.EqualTo("inputUI@truhtanov")); UnicastBus.GetUiQueueName("input").Should(Be.EqualTo("inputUI")); }
public AuditInspector(UnicastBus bus) { this.bus = bus; }
/// <summary> /// Finalize /// </summary> public void Stop() { wcfManager.Shutdown(); if (bus != null) { bus.Dispose(); bus = null; } }
void PerformConfiguration(Action<BusConfiguration> moreConfiguration = null) { var loggingConfigurers = profileManager.GetLoggingConfigurer(); foreach (var loggingConfigurer in loggingConfigurers) { loggingConfigurer.Configure(specifier); } var configuration = new BusConfiguration(); configuration.EndpointName(endpointNameToUse); configuration.EndpointVersion(endpointVersionToUse); configuration.AssembliesToScan(assembliesToScan); configuration.DefineCriticalErrorAction(OnCriticalError); if (moreConfiguration != null) { moreConfiguration(configuration); } specifier.Customize(configuration); RoleManager.TweakConfigurationBuilder(specifier, configuration); profileManager.ActivateProfileHandlers(configuration); bus = (UnicastBus) Bus.Create(configuration); }
public HostIdFixer(UnicastBus bus) { this.bus = bus; }
public HostIdFixer(UnicastBus bus) { Guid hostId = CreateGuid(Environment.MachineName, Configure.EndpointName); string identifier = Assembly.GetExecutingAssembly().Location; bus.HostInformation = new HostInformation(hostId, Environment.MachineName, identifier); }
public void SetUp() { HandlerInvocationCache.Clear(); SettingsHolder.Reset(); SettingsHolder.SetDefault("Endpoint.SendOnly", false); Transport = new FakeTransport(); FuncBuilder = new FuncBuilder(); Configure.GetEndpointNameAction = () => "TestEndpoint"; const string localAddress = "endpointA"; MasterNodeAddress = new Address(localAddress, "MasterNode"); subscriptionPredicatesEvaluator = new SubscriptionPredicatesEvaluator(); router = new StaticMessageRouter(KnownMessageTypes()); handlerRegistry = new MessageHandlerRegistry(); MessageMetadataRegistry = new MessageMetadataRegistry { DefaultToNonPersistentMessages = false }; try { Address.InitializeLocalAddress(localAddress); } catch // intentional { } MessageSerializer = new XmlMessageSerializer(MessageMapper); ExtensionMethods.GetStaticOutgoingHeadersAction = () => MessageHeaderManager.staticHeaders; gatewayAddress = MasterNodeAddress.SubScope("gateway"); messageSender = MockRepository.GenerateStub <ISendMessages>(); subscriptionStorage = new FakeSubscriptionStorage(); subscriptionManager = new MessageDrivenSubscriptionManager { Builder = FuncBuilder, MessageSender = messageSender, SubscriptionStorage = subscriptionStorage }; FuncBuilder.Register <IMutateOutgoingTransportMessages>(() => headerManager); FuncBuilder.Register <IMutateIncomingMessages>(() => new FilteringMutator { SubscriptionPredicatesEvaluator = subscriptionPredicatesEvaluator }); FuncBuilder.Register <IMutateOutgoingTransportMessages>(() => new SentTimeMutator()); FuncBuilder.Register <IMutateIncomingTransportMessages>(() => subscriptionManager); FuncBuilder.Register <DefaultDispatcherFactory>(() => new DefaultDispatcherFactory()); FuncBuilder.Register <EstimatedTimeToSLABreachCalculator>(() => SLABreachCalculator); FuncBuilder.Register <ExtractIncomingPrincipal>(() => new WindowsImpersonator()); unicastBus = new UnicastBus { MasterNodeAddress = MasterNodeAddress, MessageSerializer = MessageSerializer, Builder = FuncBuilder, MessageSender = messageSender, Transport = Transport, MessageMapper = MessageMapper, MessagePublisher = new StorageDrivenPublisher { MessageSender = messageSender, SubscriptionStorage = subscriptionStorage }, MessageDeferrer = new TimeoutManagerDeferrer { MessageSender = messageSender, TimeoutManagerAddress = MasterNodeAddress.SubScope("Timeouts") }, SubscriptionManager = subscriptionManager, MessageMetadataRegistry = MessageMetadataRegistry, SubscriptionPredicatesEvaluator = subscriptionPredicatesEvaluator, HandlerRegistry = handlerRegistry, MessageRouter = router }; bus = unicastBus; FuncBuilder.Register <IMutateOutgoingTransportMessages>(() => new CausationMutator { Bus = bus }); FuncBuilder.Register <IBus>(() => bus); ExtensionMethods.SetHeaderAction = headerManager.SetHeader; }
public StartProcessingListener(UnicastBus bus, Context context) { this.bus = bus; this.context = context; bus.Transport.StartedMessageProcessing += transport_StartedMessageProcessing; }