Exemplo n.º 1
0
 public RabbitMessageQueue(IConnectionFactory connectionFactory, MessageSubscriptionManager subscriptionManager, RabbitMessageQueueOptions?options = null, ILogger <RabbitMessageQueue>?logger = null)
 {
     _connectionFactory   = connectionFactory;
     _logger              = logger;
     _options             = options ?? new RabbitMessageQueueOptions();
     _subscriptionManager = subscriptionManager;
 }
Exemplo n.º 2
0
 public RabbitMessageQueue(IConnectionFactory connectionFactory, RabbitMessageQueueOptions?options = null, ILogger <RabbitMessageQueue>?logger = null)
 {
     _connectionFactory   = connectionFactory;
     _logger              = logger;
     _options             = options ?? new RabbitMessageQueueOptions();
     _subscriptionManager = new MessageSubscriptionManager(null, _options.Exchange.Name);
 }
Exemplo n.º 3
0
        public RabbitBroadCastService(
            BroadcastServiceOptions options,
            IConnectionFactory connectionFactory,
            BroadcastSubscriptionManager subscriptionManager,
            ILoggerFactory loggerFactory)
        {
            this.options         = options;
            _subscriptionManager = subscriptionManager;
            var queueOptions = new RabbitMessageQueueOptions
            {
                Hostname   = options.Hostname,
                RetryCount = options.RetryCount,
                Exchange   = new ExchangeConfig
                {
                    Name = options.Exchange
                },
                Queue = new QueueConfig
                {
                    Name       = null,
                    Durable    = false,
                    AutoDelete = true,
                    Exclusive  = true
                }
            };

            _queue = new RabbitMessageQueue(connectionFactory,
                                            _subscriptionManager.messageSubscriptionManager,
                                            queueOptions,
                                            loggerFactory.CreateLogger <RabbitMessageQueue>());
        }