コード例 #1
0
        public MessageQueueWorker(QueueConfig queueConfig, Func <IQueueConsumer> consumerFactory, IMessageQueueCommandExecutor commandExecutor, Func <IMessageQueueSession, IMessageQueue> messageQueueFactory)
        {
            if (queueConfig == null)
            {
                throw new ArgumentNullException("queueConfig");
            }

            if (consumerFactory == null)
            {
                throw new ArgumentNullException("consumerFactory");
            }

            if (commandExecutor == null)
            {
                throw new ArgumentNullException("commandExecutor");
            }

            if (messageQueueFactory == null)
            {
                throw new ArgumentNullException("messageQueueFactory");
            }

            _queueConfig         = queueConfig;
            _consumerFactory     = consumerFactory;
            _commandExecutor     = commandExecutor;
            _messageQueueFactory = messageQueueFactory;

            _startedEvent = new CountdownEvent(queueConfig.QueueWorkerThreadCount);
            _stoppedEvent = new CountdownEvent(queueConfig.QueueWorkerThreadCount);
        }
コード例 #2
0
        public MessageQueuePublisher(IMessageQueueCommandExecutor queueCommandExecutor)
        {
            if (queueCommandExecutor == null)
            {
                throw new ArgumentNullException("queueCommandExecutor");
            }

            _queueCommandExecutor = queueCommandExecutor;
        }
コード例 #3
0
        public MessageQueueManager(IMessageQueueCommandExecutor queueCommandExecutor, IMessageQueueWorkerContainer queueWorkerContainer, Action <IExchangeConfig> defaultExchangeConfig = null, Action <IQueueConfig> defaultQueueConfig = null)
        {
            if (queueCommandExecutor == null)
            {
                throw new ArgumentNullException("queueCommandExecutor");
            }

            if (queueWorkerContainer == null)
            {
                throw new ArgumentNullException("queueWorkerContainer");
            }

            _queueCommandExecutor  = queueCommandExecutor;
            _queueWorkerContainer  = queueWorkerContainer;
            _defaultExchangeConfig = defaultExchangeConfig;
            _defaultQueueConfig    = defaultQueueConfig;
        }
コード例 #4
0
        public ExchangeBinding(string exchangeName, IMessageQueueCommandExecutor queueCommandExecutor, IMessageQueueWorkerContainer queueWorkerContainer, Action <IQueueConfig> defaultQueueConfig = null)
        {
            if (string.IsNullOrWhiteSpace(exchangeName))
            {
                throw new ArgumentNullException("exchangeName");
            }

            if (queueCommandExecutor == null)
            {
                throw new ArgumentNullException("queueCommandExecutor");
            }

            if (queueWorkerContainer == null)
            {
                throw new ArgumentNullException("queueWorkerContainer");
            }

            _exchangeName         = exchangeName;
            _queueCommandExecutor = queueCommandExecutor;
            _queueWorkerContainer = queueWorkerContainer;
            _defaultQueueConfig   = defaultQueueConfig;
        }