basic concepts about MSMQ

來源:互聯網
上載者:User

MSMQ is a technichque through which the processes or computers in distributed systems communicate and exchange data asychrounsely and stablely.

2 the type of MSMQ:
 1.Private MQ
 this kind of MSMQ can only be stored in local host and the messages are transferred among the processes of local host
2. public MQ
 this kind of MSMQ can be delieverd among the destributed system only if the hosts are in the arange of  demain/workgroup. MSMQ can work although the destination-hosts are off-line, cos the Messages are stored in client,  in which there is an backend process to broadcast them. only if the receiving destination are on-line, it may receive  the messages then.
3.System MQ
 this kind of MSMQ is about the system operation special message queues that be encapsulated as Message to broadcast in demain/workgroup. I have not so much ideas about this MSMQ.

3the content of MSMQ:
 1.simple text message
 in the simplest case, the message can be just simple text
2.object message
 the message that is to be sent also can be an object

4 the formatter of MSMQ
1.XML
2.Binary file
note:the client and server must keep the same formatter to send/receive MSMQ,eithor XML or Binary file all.

5 class and operations/methods concerned in .net framework using C#
  1.concerned class: System.Messaging---MessageQuequ, Message
 2.main concerned methods/operations
  1) MessageQuequ.Exists(MSMQ_Name)  
   ---to judge the MSMQ named MSMQ_Name does already exists.if do, return true, else return false;
  2) MessageQueue.Create(MSMQ_Name)
   ---to create a MSMQ named MSMQ_Name, and return the instance of an Message queue.
  3) the formatter of message
   //binary file format
    System.Messaging.Formatter=System.Messaging.BinaryMessageFormatter(new Type[]{message_type});
    //XML format
    System.Messaging.Formatter=System.Messaging.xmlMessageFormatter(new Type[]{message_type});
  3) assume obj_message is an instance about System.Messaging.Message
   //initialize an instance of message
   obj_message=new System.Messaging.Message(message_content)
   //send message
   obj_message.send()
   //receive message syncronousely
   obj_message.receive()
   //receive message asyncronousely
   obj_message.beginreceive()

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.