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(); } } }
public OrderProcessor(QueueChannel channel, QueueingBasicConsumer consumer, OrderRepository orderRepository) { this.channel = channel; this.consumer = consumer; this.orderRepository = orderRepository; }