Esempio n. 1
0
        private static void Main(string[] args)
        {
            SessionFactory.Create();
            OrderRepository orderRepository = new OrderRepository();

            using (var channel = new QueueChannel("request queue"))
            {
                var consumer = channel.CreateConsumer();

                var processor = new OrderProcessor(channel, consumer, orderRepository);
                while (true)
                {
                    processor.Process();
                }
            }
        }
Esempio n. 2
0
 public OrderProcessor(QueueChannel channel, QueueingBasicConsumer consumer, OrderRepository orderRepository)
 {
     this.channel = channel;
     this.consumer = consumer;
     this.orderRepository = orderRepository;
 }