コード例 #1
0
        public RabbitMessageBusConsumer(IAdvancedBus bus, ExchangeConfiguration exchangeConfiguration, QueueConfiguration queueConfiguration, ILogger <RabbitMessageBusConsumer <T> > logger, MessageBusOptions options)
            : base(bus, exchangeConfiguration, queueConfiguration, options)
        {
            _logger = logger;

            ConfigureBusEvents();
        }
コード例 #2
0
 public static IServiceCollection AddMessageBusPublisher <T>(this IServiceCollection services, ExchangeConfiguration exchangeConfiguration, QueueConfiguration queueConfiguration, ServiceLifetime serviceLifetime) where T : class
 {
     services.Add(new ServiceDescriptor(typeof(IMessageBusPublisher <T>), s => new RabbitMessageBusPublisher <T>(s.GetRequiredService <IAdvancedBus>(), exchangeConfiguration, queueConfiguration, s.GetRequiredService <MessageBusOptions>()), serviceLifetime));
     return(services);
 }
コード例 #3
0
 public RabbitMessageBusPublisher(IAdvancedBus bus, ExchangeConfiguration exchangeConfiguration, QueueConfiguration queueConfiguration, MessageBusOptions options)
     : base(bus, exchangeConfiguration, queueConfiguration)
 {
     _options = options;
 }
コード例 #4
0
 public static IServiceCollection AddMessageBusPublisher <T>(this IServiceCollection services, ExchangeConfiguration exchangeConfiguration, QueueConfiguration queueConfiguration) where T : class =>
 AddMessageBusPublisher <T>(services, exchangeConfiguration, queueConfiguration, ServiceLifetime.Singleton);
コード例 #5
0
        protected RabbitMessageBusBase(IAdvancedBus bus, ExchangeConfiguration exchangeConfiguration, QueueConfiguration queueConfiguration)
        {
            Bus = bus ?? throw new ArgumentNullException(nameof(bus));
            ExchangeConfiguration = exchangeConfiguration ?? throw new ArgumentNullException(nameof(exchangeConfiguration));
            QueueConfiguration    = queueConfiguration ?? throw new ArgumentNullException(nameof(queueConfiguration));

            Setup();
        }