예제 #1
0
        private void ConsumerQueue()
        {
            var channel = _connection.CreateModel();

            _rabbitService.DeclareQueue(ref channel);
            var consumer = _rabbitService.ConsumerQueue(ref channel);

            consumer.Received += (sender, response) =>
            {
                var model = sender as EventingBasicConsumer;
                ProcessMessage(consumer.Model, response.Body, response.DeliveryTag);
            };
            channel.BasicConsume(RabbitMQConfiguration.QueueName, false, consumer);
        }