Overview of Microsoft Message Queue

< BACK  NEXT >
[oR]

Microsoft Message Queue (MSMQ) is a service that allows queues to be created on a computer, and for applications to write and read messages to and from the queues. Applications can access queues that are located on other computers. In the case of writing to a queue, an application can write messages to a queue located on another computer, and if the other computer is not connected, the messages are queued on the local computer. Once the computers are again connected, MSMQ automatically transfers the messages. Messages can only be read from queues on connected computers.

Any application, subject to permissions and security, can read or write messages from or to a queue. This means that a queue can be used for two-way data transmission. A queue can service requests from applications running on different computers, as each message has a sender identifier. Messages in a queue can store data in different formats. It is up to the application to interpret the format of the data. Messages have several important data items associated with them, including the following:

  • Label A textual description of the message. Useful for identifying the type of data contained in the message.

  • Body The "payload" of the data, which can be textual or binary data of variable length.

  • Time queued A timestamp of when the message was queued.

  • Time arrived A timestamp indicating when the message was received by the queue.

  • Sender identifier Indicates the computer that sent the message.

MSMQ provides several features that are essential in a disconnected environment:

  • Reliability. MSMQ provides all-or-nothing transmission of messages. Partially delivered messages will be deleted, and the original message will be resent when the next connection is made.

  • Once-only delivery. MSMQ ensures that messages are not duplicated.

  • In-order delivery. MSMQ ensures that messages will be read from a queue in the same order as they were written.

  • Transactional support. Applications can use transactions to back out messages associated with transactions that cannot be completed. This feature is somewhat limited on Windows CE.

MSMQ uses TCP/IP sockets to provide communications and is available on Windows CE, NT, 98, and 2000. Queues use names based on Domain Name Service (DNS) names rather than IP addresses. This allows for dynamic allocation of TCP/IP addresses. As with most services, Windows CE provides a limited but useful subset of functionality found on the desktop.

There are two types of queues public and private. Public queues are given a computer-independent name (that is, not based on a DNS or IP address). The location of the queue is resolved using Active Directory when the queue is accessed. Private queues use the DNS name of the computer and do not require Active Directory for resolution. This is faster, but means that applications need to know the physical location of a queue. Only private queues are supported in Windows CE.


< BACK  NEXT >


Windows CE 3. 0 Application Programming
Windows CE 3.0: Application Programming (Prentice Hall Series on Microsoft Technologies)
ISBN: 0130255920
EAN: 2147483647
Year: 2002
Pages: 181

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net