Microsoft Message Queue에 대한 Utility Class 입니다.
Exemplo n.º 1
0
 public void GetAllMessageTest()
 {
     foreach (Message m in MsmqTool.GetAllMessages(MsmqTool.PRIVATE_PATH + SamplePrivateQueue))
     {
         Console.WriteLine("Message Body: " + m.Body);
     }
 }
Exemplo n.º 2
0
        public void EnumerationTest()
        {
            var me =
                MsmqTool.GetMessageEnumerator(MsmqTool.PRIVATE_PATH + SamplePrivateQueue, new[] { typeof(string) });

            try {
                while (me.MoveNext())
                {
                    var m = me.Current;
                    Console.WriteLine("Message Body: " + m.Body);

                    me.RemoveCurrent(); // Pick 이냐 Retrieve 냐
                }
            }
            finally {
                if (me != null)
                {
                    me.Dispose();
                }
            }
        }
Exemplo n.º 3
0
 private static MessageQueue GetPrivateQueue(string queueName)
 {
     return(MsmqTool.CreatePrivateQueue(queueName, queueName, false));
 }
Exemplo n.º 4
0
 public void SendMessageTest()
 {
     MsmqTool.Send(MsmqTool.PRIVATE_PATH + SamplePrivateQueue, "Simple Text", "Sample Label");
     MsmqTool.Send(MsmqTool.PRIVATE_PATH + SamplePrivateQueue, "Simple Text2", "Sample Label2");
 }