Esempio n. 1
0
 static void Main(string[] args)
 {
     Parallel.For(0, RabbitMQConfig.ThreadCount, i =>
     {
         IMessageCustomer customer = new MessageCustomer("test");
         customer.StartListening();
         customer.ReceiveMessageCallback = message =>
         {
             Console.WriteLine("接收到消息:" + message);
             return(true);
         };
     });
     Console.Read();
 }
Esempio n. 2
0
        static void Main(string[] args)
        {
            while (true)
            {
                IMessageCustomer customer = new MessageCustomer("test");
                customer.StartListening();
                customer.ReceiveMessageCallback = message =>
                {
                    Console.WriteLine("接收到消息:" + message);
                    return(false);
                };

                Thread.Sleep(2000);
            }
            Console.Read();
        }