Ejemplo n.º 1
0
 public RabbitMQMemoryBus(IRabbitMQChannelFactory channelFactory, RabbitMQOptions options,
                          ISubscriptionManager subscriptionManager, IIntegrationEventAggregation integrationEventAggregation)
 {
     _channelFactory              = channelFactory;
     _subscriptionManager         = subscriptionManager;
     _integrationEventAggregation = integrationEventAggregation;
     _queueName = options.QueueName;
     Logger     = NullLogger <RabbitMqChannelFactory> .Instance;
     InitializeQueue();
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 3
0
 public RabbitMqChannelFactory(RabbitMQOptions rabbitMqOptions)
 {
     _rabbitMqOptions = rabbitMqOptions;
     Logger           = NullLogger <RabbitMqChannelFactory> .Instance;
 }