public RabbitMQMemoryBus(IRabbitMQChannelFactory channelFactory, RabbitMQOptions options,
                          ISubscriptionManager subscriptionManager, IIntegrationEventAggregation integrationEventAggregation)
 {
     _channelFactory              = channelFactory;
     _subscriptionManager         = subscriptionManager;
     _integrationEventAggregation = integrationEventAggregation;
     _queueName = options.QueueName;
     Logger     = NullLogger <RabbitMqChannelFactory> .Instance;
     InitializeQueue();
 }
Exemple #2
0
 public static IServiceCollection AddRabbitMq(this IServiceCollection serviceCollection, RabbitMQOptions options, params Assembly[] eventHandlersAssemblies)
 {
     serviceCollection.AddTransient <RabbitMQOptions>(provider => options);
     serviceCollection.AddSingleton <ISubscriptionManager, SubscriptionManager>();
     serviceCollection.AddSingleton <IRabbitMQChannelFactory, RabbitMqChannelFactory>();
     serviceCollection.AddSingleton <IRabbitMQMemoryBus, RabbitMQMemoryBus>();
     serviceCollection.AddSingleton <IntegrationEventHandlerFactory>(provider => (t) => provider.GetService(t));
     serviceCollection.RegisterGenericType(typeof(IIntegrationEventHandler <>), ServiceLifetime.Transient, eventHandlersAssemblies);
     serviceCollection.RegisterAssembly(typeof(IDynamicIntegrationEventHandler), ServiceLifetime.Transient, eventHandlersAssemblies);
     serviceCollection.AddSingleton <IIntegrationEventAggregation, IntegrationEventAggregation>();
     return(serviceCollection);
 }
Exemple #3
0
 public RabbitMqChannelFactory(RabbitMQOptions rabbitMqOptions)
 {
     _rabbitMqOptions = rabbitMqOptions;
     Logger           = NullLogger <RabbitMqChannelFactory> .Instance;
 }