예제 #1
0
        /// <summary>
        /// Creates the consumer.
        /// </summary>
        public void CreateBasicConsumer()
        {
            if (_rabbitWrapperType == RabbitWrapperType.Output)
            {
                return;
            }

            while (true)
            {
                try
                {
                    _consumer = BasicConsumerFactory.CreateQueueConsumer(_connection.Channel, _connection.QueueName);
                    break;
                }
                catch (Exception exception)
                {
                    Logger.Error("Error Socket Rabbit (AlreadyClosedException), intentando reconectar", exception);
                    Reconnect();
                }
            }
        }
예제 #2
0
        /// <summary>
        /// Creates the consumer.
        /// </summary>
        public void CreateBasicConsumer()
        {
            if (_rabbitWrapperType == RabbitWrapperType.Output)
            {
                return;
            }

            while (true)
            {
                try
                {
                    _consumer = BasicConsumerFactory.CreateQueueConsumer(_connection.Channel, _connection.QueueName);
                    break;
                }
                catch (Exception exception)
                {
                    Logger.Error("Error Socket Rabbit (AlreadyClosedException), intentando reconectar", exception);
                    Reconnect();
                }
            }
        }