Beispiel #1
0
        static void Main(string[] args)
        {
            Task.Run(() =>
            {
                //while (true)
                //{

                //}
                Order data = new Order {
                    orderId = Guid.NewGuid(), orderTime = DateTime.Now
                };
                MSMQDemo.SendMessage(data);
                Console.WriteLine($"发出消息Order Id:{data.orderId}");
                //Thread.Sleep(3000);
            });

            Task.Run(() =>
            {
                //while (true)
                //{

                //}
                MSMQDemo.ReceiveMessage();
                Thread.Sleep(3000);
            });


            Console.Read();
        }
Beispiel #2
0
 public void SendMessageTest()
 {
     MSMQDemo.SendMessage(new Order {
         orderId = Guid.NewGuid(), orderTime = DateTime.Now
     });
 }