private void RegisterRhinoQueuesTransport(AbstractRhinoServiceBusConfiguration c, IBusContainerBuilder b, IServiceLocator l) { var busConfig = c.ConfigurationSection.Bus; var queueManagerConfiguration = new QueueManagerConfiguration(); b.RegisterSingleton <ISubscriptionStorage>(() => (ISubscriptionStorage) new PhtSubscriptionStorage( busConfig.SubscriptionPath, l.Resolve <IMessageSerializer>(), l.Resolve <IReflection>())); b.RegisterSingleton <ITransactionStrategy>(() => new TransactionScopeStrategy()); b.RegisterSingleton <ITransport>(() => (ITransport) new RhinoQueuesTransport( c.Endpoint, l.Resolve <IEndpointRouter>(), l.Resolve <IMessageSerializer>(), c.ThreadCount, busConfig.QueuePath, c.IsolationLevel, c.NumberOfRetries, busConfig.EnablePerformanceCounters, l.Resolve <IMessageBuilder <MessagePayload> >(), queueManagerConfiguration, l.Resolve <ITransactionStrategy>())); b.RegisterSingleton <IMessageBuilder <MessagePayload> >(() => (IMessageBuilder <MessagePayload>) new RhinoQueuesMessageBuilder( l.Resolve <IMessageSerializer>(), l.Resolve <IServiceLocator>())); b.RegisterSingleton <QueueManagerConfiguration>(() => queueManagerConfiguration); }
private void RegisterRhinoQueuesTransport(AbstractRhinoServiceBusConfiguration c, IBusContainerBuilder b, IServiceLocator l) { var busConfig = c.ConfigurationSection.Bus; var fileManagerConfiguration = new QueueManagerConfiguration(); b.RegisterSingleton<ISubscriptionStorage>(() => (ISubscriptionStorage)new FileSubscriptionStorage( busConfig.SubscriptionPath, l.Resolve<IMessageSerializer>(), l.Resolve<IReflection>())); b.RegisterSingleton<ITransport>(() => (ITransport)new RhinoFilesTransport( c.Endpoint, l.Resolve<IEndpointRouter>(), l.Resolve<IMessageSerializer>(), c.ThreadCount, busConfig.QueuePath, c.IsolationLevel, c.NumberOfRetries, busConfig.EnablePerformanceCounters, l.Resolve<IMessageBuilder<MessagePayload>>(), fileManagerConfiguration)); b.RegisterSingleton<IMessageBuilder<MessagePayload>>(() => (IMessageBuilder<MessagePayload>)new RhinoFilesMessageBuilder( l.Resolve<IMessageSerializer>(), l.Resolve<IServiceLocator>())); b.RegisterSingleton<QueueManagerConfiguration>(() => fileManagerConfiguration); }
private void RegisterSqlQueuesTransport(AbstractRhinoServiceBusConfiguration c, IBusContainerBuilder b, IServiceLocator l) { var busConfig = c.ConfigurationSection.Bus; b.RegisterSingleton<IStorage>(() => new SqlStorage(busConfig.Path ?? QueueConnectionStringContainer.ConnectionString)); b.RegisterSingleton<ISubscriptionStorage>(() => new GenericSubscriptionStorage( l.Resolve<IStorage>(), c.Endpoint.ToString(), l.Resolve<IMessageSerializer>(), l.Resolve<IReflection>())); b.RegisterSingleton<ITransport>(() => new SqlQueuesTransport( c.Endpoint, l.Resolve<IEndpointRouter>(), l.Resolve<IMessageSerializer>(), c.ThreadCount, busConfig.Path ?? QueueConnectionStringContainer.ConnectionString, c.NumberOfRetries, l.Resolve<IMessageBuilder<MessagePayload>>())); b.RegisterSingleton<IMessageBuilder<MessagePayload>>(() => new SqlQueuesMessageBuilder( l.Resolve<IMessageSerializer>(), l.Resolve<IServiceLocator>())); }
private void RegisterSqlQueuesTransport(AbstractRhinoServiceBusConfiguration c, IBusContainerBuilder b, IServiceLocator l) { var busConfig = c.ConfigurationSection.Bus; b.RegisterSingleton <IStorage>(() => new SqlStorage(busConfig.Path ?? QueueConnectionStringContainer.ConnectionString)); b.RegisterSingleton <ISubscriptionStorage>(() => new GenericSubscriptionStorage( l.Resolve <IStorage>(), c.Endpoint.ToString(), l.Resolve <IMessageSerializer>(), l.Resolve <IReflection>())); b.RegisterSingleton <ITransport>(() => new SqlQueuesTransport( c.Endpoint, l.Resolve <IEndpointRouter>(), l.Resolve <IMessageSerializer>(), c.ThreadCount, busConfig.Path ?? QueueConnectionStringContainer.ConnectionString, c.NumberOfRetries, l.Resolve <IMessageBuilder <MessagePayload> >())); b.RegisterSingleton <IMessageBuilder <MessagePayload> >(() => new SqlQueuesMessageBuilder( l.Resolve <IMessageSerializer>(), l.Resolve <IServiceLocator>())); }
private void RegisterMsmqOneWay(AbstractRhinoServiceBusConfiguration c, IBusContainerBuilder b, IServiceLocator l) { var oneWayConfig = (OnewayRhinoServiceBusConfiguration)c; b.RegisterSingleton<IMessageBuilder<Message>>(() => (IMessageBuilder<Message>)new MsmqMessageBuilder( l.Resolve<IMessageSerializer>(), l.Resolve<IServiceLocator>())); b.RegisterSingleton<IOnewayBus>(() => (IOnewayBus)new MsmqOnewayBus( oneWayConfig.MessageOwners, l.Resolve<IMessageBuilder<Message>>(),oneWayConfig.ConfigurationSection.Bus.UseDeadLetterQueue)); }
private void RegisterMsmqOneWay(AbstractRhinoServiceBusConfiguration c, IBusContainerBuilder b, IServiceLocator l) { var oneWayConfig = (OnewayRhinoServiceBusConfiguration)c; b.RegisterSingleton <IMessageBuilder <Message> >(() => (IMessageBuilder <Message>) new MsmqMessageBuilder( l.Resolve <IMessageSerializer>(), l.Resolve <IServiceLocator>())); b.RegisterSingleton <IOnewayBus>(() => (IOnewayBus) new MsmqOnewayBus( oneWayConfig.MessageOwners, l.Resolve <IMessageBuilder <Message> >())); }
private void RegisterSqlQueuesOneWay(AbstractRhinoServiceBusConfiguration c, IBusContainerBuilder b, IServiceLocator l) { var oneWayConfig = (OnewayRhinoServiceBusConfiguration)c; var busConfig = c.ConfigurationSection.Bus; b.RegisterSingleton<IMessageBuilder<MessagePayload>>(() => new SqlQueuesMessageBuilder( l.Resolve<IMessageSerializer>(), l.Resolve<IServiceLocator>())); b.RegisterSingleton<IOnewayBus>(() => new SqlQueuesOneWayBus( oneWayConfig.MessageOwners, l.Resolve<IMessageSerializer>(), busConfig.Path ?? QueueConnectionStringContainer.ConnectionString, l.Resolve<IMessageBuilder<MessagePayload>>())); }
private void RegisterSqlQueuesOneWay(AbstractRhinoServiceBusConfiguration c, IBusContainerBuilder b, IServiceLocator l) { var oneWayConfig = (OnewayRhinoServiceBusConfiguration)c; var busConfig = c.ConfigurationSection.Bus; b.RegisterSingleton <IMessageBuilder <MessagePayload> >(() => new SqlQueuesMessageBuilder( l.Resolve <IMessageSerializer>(), l.Resolve <IServiceLocator>())); b.RegisterSingleton <IOnewayBus>(() => new SqlQueuesOneWayBus( oneWayConfig.MessageOwners, l.Resolve <IMessageSerializer>(), busConfig.Path ?? QueueConnectionStringContainer.ConnectionString, l.Resolve <IMessageBuilder <MessagePayload> >())); }
private void RegisterRhinoQueuesOneWay(AbstractRhinoServiceBusConfiguration c, IBusContainerBuilder b, IServiceLocator l) { var oneWayConfig = (OnewayRhinoServiceBusConfiguration)c; var busConfig = c.ConfigurationSection.Bus; b.RegisterSingleton<IMessageBuilder<MessagePayload>>(() => (IMessageBuilder<MessagePayload>)new RhinoQueuesMessageBuilder( l.Resolve<IMessageSerializer>(), l.Resolve<IServiceLocator>())); b.RegisterSingleton<IOnewayBus>(() => (IOnewayBus)new RhinoQueuesOneWayBus( oneWayConfig.MessageOwners, l.Resolve<IMessageSerializer>(), busConfig.QueuePath, busConfig.EnablePerformanceCounters, l.Resolve<IMessageBuilder<MessagePayload>>())); }
private void RegisterRhinoQueuesOneWay(AbstractRhinoServiceBusConfiguration c, IBusContainerBuilder b, IServiceLocator l) { var oneWayConfig = (OnewayRhinoServiceBusConfiguration)c; var busConfig = c.ConfigurationSection.Bus; b.RegisterSingleton <IMessageBuilder <MessagePayload> >(() => (IMessageBuilder <MessagePayload>) new RhinoQueuesMessageBuilder( l.Resolve <IMessageSerializer>(), l.Resolve <IServiceLocator>())); b.RegisterSingleton <IOnewayBus>(() => (IOnewayBus) new RhinoQueuesOneWayBus( oneWayConfig.MessageOwners, l.Resolve <IMessageSerializer>(), busConfig.QueuePath, busConfig.EnablePerformanceCounters, l.Resolve <IMessageBuilder <MessagePayload> >())); }
private void RegisterMsmqTransport(AbstractRhinoServiceBusConfiguration c, IBusContainerBuilder b, IServiceLocator l, Type queueStrategyType) { if (queueStrategyType == typeof(FlatQueueStrategy)) { b.RegisterSingleton <IQueueStrategy>(() => (IQueueStrategy) new FlatQueueStrategy( l.Resolve <IEndpointRouter>(), c.Endpoint)); } else { b.RegisterSingleton <IQueueStrategy>(() => (IQueueStrategy) new SubQueueStrategy()); } if (c.UseDtc) { b.RegisterSingleton <ITransactionStrategy>(() => new TransactionScopeStrategy()); } else { b.RegisterSingleton <ITransactionStrategy>(() => new MsmqTransactionStrategy()); } b.RegisterSingleton <IMessageBuilder <Message> >(() => (IMessageBuilder <Message>) new MsmqMessageBuilder( l.Resolve <IMessageSerializer>(), l.Resolve <IServiceLocator>())); b.RegisterSingleton <IMsmqTransportAction>(Guid.NewGuid().ToString(), () => (IMsmqTransportAction) new ErrorAction( c.NumberOfRetries, l.Resolve <IQueueStrategy>())); b.RegisterSingleton <ISubscriptionStorage>(() => (ISubscriptionStorage) new MsmqSubscriptionStorage( l.Resolve <IReflection>(), l.Resolve <IMessageSerializer>(), c.Endpoint, l.Resolve <IEndpointRouter>(), l.Resolve <IQueueStrategy>())); b.RegisterSingleton <ITransport>(() => (ITransport) new MsmqTransport( l.Resolve <IMessageSerializer>(), l.Resolve <IQueueStrategy>(), c.Endpoint, c.ThreadCount, l.ResolveAll <IMsmqTransportAction>().ToArray(), l.Resolve <IEndpointRouter>(), c.IsolationLevel, c.Transactional, c.ConsumeInTransaction, l.Resolve <IMessageBuilder <Message> >(), l.Resolve <ITransactionStrategy>())); b.RegisterAll <IMsmqTransportAction>(typeof(ErrorAction)); }
private void RegisterMsmqTransport(AbstractRhinoServiceBusConfiguration c, IBusContainerBuilder b, IServiceLocator l, Type queueStrategyType) { if (queueStrategyType == typeof(FlatQueueStrategy)) b.RegisterSingleton<IQueueStrategy>(() => (IQueueStrategy)new FlatQueueStrategy( l.Resolve<IEndpointRouter>(), c.Endpoint)); else b.RegisterSingleton<IQueueStrategy>(() => (IQueueStrategy)new SubQueueStrategy()); b.RegisterSingleton<IMessageBuilder<Message>>(() => (IMessageBuilder<Message>)new MsmqMessageBuilder( l.Resolve<IMessageSerializer>(), l.Resolve<IServiceLocator>())); b.RegisterSingleton<IMsmqTransportAction>(Guid.NewGuid().ToString(), () => (IMsmqTransportAction)new ErrorAction( c.NumberOfRetries, l.Resolve<IQueueStrategy>())); b.RegisterSingleton<ISubscriptionStorage>(() => (ISubscriptionStorage)new MsmqSubscriptionStorage( l.Resolve<IReflection>(), l.Resolve<IMessageSerializer>(), c.Endpoint, l.Resolve<IEndpointRouter>(), l.Resolve<IQueueStrategy>())); b.RegisterSingleton<ITransport>(() => (ITransport)new MsmqTransport( l.Resolve<IMessageSerializer>(), l.Resolve<IQueueStrategy>(), c.Endpoint, c.ThreadCount, l.ResolveAll<IMsmqTransportAction>().ToArray(), l.Resolve<IEndpointRouter>(), c.IsolationLevel, c.Transactional, c.ConsumeInTransaction, l.Resolve<IMessageBuilder<Message>>())); b.RegisterAll<IMsmqTransportAction>(typeof(ErrorAction)); }
private void RegisterQueueCreation(IBusContainerBuilder b, IServiceLocator l) { b.RegisterSingleton <IServiceBusAware>(Guid.NewGuid().ToString(), () => (IServiceBusAware) new QueueCreationModule( l.Resolve <IQueueStrategy>())); }
private void RegisterQueueCreation(IBusContainerBuilder b, IServiceLocator l) { b.RegisterSingleton<IServiceBusAware>(Guid.NewGuid().ToString(), () => (IServiceBusAware)new QueueCreationModule( l.Resolve<IQueueStrategy>())); }