예제 #1
0
 public IQueueConsumer GetConsumer(string queueName, ConsumerCountManager consumerCountManager, IMessageProcessingWorker messageProcessingWorker, Type expectedType, IMessageRejectionHandler messageRejectionHandler)
 {
     return(new RabbitMQConsumer(
                connectionPool: this.ConnectionPool,
                queueName: queueName,
                expectedType: expectedType,
                messageProcessingWorker: messageProcessingWorker,
                consumerCountManager: consumerCountManager,
                messageRejectionHandler: messageRejectionHandler));
 }
예제 #2
0
        public RabbitMQConsumer(RabbitMQConnectionPool connectionPool, string queueName, Type expectedType, IMessageProcessingWorker messageProcessingWorker, ConsumerCountManager consumerCountManager, IMessageRejectionHandler messageRejectionHandler)
        {
            //Set using constructor parameters
            this.ConnectionPool          = connectionPool;
            this.QueueName               = queueName;
            this.ExpectedType            = expectedType;
            this.MessageProcessingWorker = messageProcessingWorker;
            this._consumerCountManager   = consumerCountManager;
            this.MessageRejectionHandler = messageRejectionHandler;

            //Set using default values
            this._consumerWorkersCount    = 0;
            this._cancellationTokenSource = new CancellationTokenSource();
            this._isStopped = true;
        }