/// <summary>
        /// Выполняет подписку на очередь
        /// </summary>
        /// <param name="domainLogic">Бизнес-логика</param>
        public void SubscribeOnQueue(DomainLogic domainLogic)
        {
            IConnection connection = GetRabbitMqConnection();
            IModel      model      = connection.CreateModel();

            model.BasicQos(0, 1, false);

            MessageReceiver messageReceiver = new MessageReceiver(model, domainLogic);

            model.BasicConsume(QueueName, false, messageReceiver);
        }
 public MessageReceiver(IModel channel, DomainLogic domainLogic)
 {
     _channel     = channel;
     _domainLogic = domainLogic;
 }
Beispiel #3
0
 /// <summary>
 /// Выполняет подписку на получение новых сообщений
 /// </summary>
 /// <param name="domainLogic"></param>
 public void SubscribeOn(DomainLogic domainLogic)
 {
     _rabbitMqClient.SubscribeOnQueue(domainLogic);
 }