Microsoft Message Queue Server

MSMQ is provided as part of the Microsoft Windows NT 4.0 Option Pack. The purpose of MSMQ is to provide loosely coupled and reliable network communications services based on a messaging queuing model. MSMQ makes it easy to integrate applications, implement a push-style business-event delivery environment between applications, and build reliable applications that work over unreliable but cost-effective networks.

You can think of MSMQ as a type of automated e-mail system between computers. MSMQ is able to deliver messages from one application to another in an asynchronous manner. This means that messages are queued up for delivery and do not require the client application to wait for delivery to be completed. The client application—and the end user—are both free to move on to other activities. Once the message has been sent to the message queue, it is guaranteed to be delivered to its recipient.

MSMQ is important because there are many business situations that require an asynchronous message delivery model. For example, let's say a customer places an order. Once the customer has placed the order, the system needs to guarantee that the order is passed to fulfillment and then shipped to the customer. This process can take place asynchronously so that the customer on the telephone (or on the Web site) does not need to wait for all the relevant processing to occur. Another example might be that of an insurance agent. The agent could go to a customer's home with his or her laptop and take an order for an insurance policy. When the agent returns to the office and connects to the network, MSMQ will forward the order to headquarters for processing. MSMQ can also inform the agent via a confirmation message that prior policy orders have been placed.

MSMQ features include the following:

  • Full COM support, dynamic directory service-based architecture, and centralized systems management.
  • Comprehensive message queuing functionality, such as resilient message delivery, cost-based message routing, and full support for transactions. MSMQ also offers interoperability with other message queuing products, such as IBM's MQSeries, through products from Level 8 Systems, Inc.
  • Complete integration with other Windows NT features, such as Microsoft Transaction Server (MTS), Microsoft Internet Information Server (IIS), Windows NT clustering services, and the Windows NT security environment.

Message Queue Concepts

Figure 21-1 shows the MSMQ message queuing model. When a message is sent from one application to another it is placed in a queue. This can be either a local queue (for example, on an independent client) or a queue on another message server. The queue can be considered a mail box that holds the messages. Once the message has been sent to the queue, it can be considered delivered. MSMQ will ensure that the message is routed from the queue to the receiving application.

Messages can be prioritized so that more important messages take precedence over lower priority messages. The priority can take a value anywhere from 0 to 7. The default priority is 3, and the highest priority is 7.

click to view at full size.

Figure 21-1. MSMQ message queuing model.

Public and private queues

MSMQ has two types of queues that you can use in your applications: public queues and private queues. A public queue is replicated throughout the MSMQ enterprise configuration using the MSMQ Information Server (MQIS). The queue can be searched for and queried by any applications using MSMQ. Private queues can be accessed only by applications that have access to the full path or format name of the queue. In the default view, the MSMQ Explorer does not display private queues.

Types of message queues

In addition to the public and private queues, there are several queues that MSMQ uses as part of the messaging process. These queues are listed below:

  • Journal Queues
  • Dead-Letter Queues
  • Transaction Dead-Letter Queues
  • Administration Queues
  • Report Queues
  • System Queues

Each of the above queues is simply a standard queue used for a particular purpose. These queues are used to separate out various types of messages that fall into the particular categories that are described below.

Journal queues

Journal queues are used to store a copy of a message in a process called journaling. There are two types of journaling available: source and target. Source journaling is the process of storing a copy of an outgoing message. Target journaling is the process of storing a copy of an incoming message.

Dead-letter queues

Messages that have expired or are undeliverable are stored in dead-letter queues. A nontransactional message that cannot reach the destination application is stored in a dead-letter queue on the computer on which the message expired (or failed).

Transaction dead-letter queues

A transactional message that cannot reach the destination application is stored in the transaction dead-letter queue on the source computer. Transaction dead-letter queues are created for each independent client and server on your MSMQ network when MSMQ is installed on that computer. The MSMQ Explorer displays these queues as Xact Dead Letter, under the computer.

Administration queues

Administration queues contain acknowledgment messages generated by MSMQ for messages you send. These messages indicate that the messages you sent either arrived (a positive acknowledgment) or that an error occurred before the message could be retrieved (a negative acknowledgment).

Report queues

Report queues contain report messages that indicate the message's route through your enterprise. Report queues can be used when sending test messages or when tracking message routes for a specific application.

System queues

MSMQ uses up to six system queues. All six are implemented as private queues and cannot be deleted. They are used for various MSMQ system purposes.

MSMQ Server Roles

MSMQ Servers can perform various roles within an enterprise configuration. These roles are as follows:

  • Primary Enterprise Controller (PEC) This is the main MSMQ server for the enterprise. There can be only one PEC and this must be installed prior to installing any other servers.
  • Primary Site Controller (PSC) Usually the main MSMQ server for a particular geographic site.
  • Backup Site Controller (BSC) A backup server in case the primary site controller goes down. The backup site controller holds a read-only copy of the PSC database.
  • Routing Server Used to route messages between sites.
  • Connector Server Used to communicate with other messaging schemes, such as Microsoft Exchange e-mail or IBM's MQSeries on the mainframe.

MSMQ Client Roles

As far as client machines go, MSMQ has two roles: dependent clients and independent clients.

MSMQ independent client software can be installed on computers running Microsoft Windows 95, Microsoft Windows 98, Windows NT Workstation version 4.0 or later, and Windows NT Server version 4.0 or later. MSMQ independent clients can create and modify queues locally, and can send and receive messages, just as MSMQ servers can. MSMQ independent clients can create queues and store messages on the local computer, without synchronous access to an MSMQ server. The primary differences between MSMQ independent clients and MSMQ servers are that independent clients do not have the intermediate store-and-forward capability of MSMQ servers, nor do they store information from the distributed MSMQ database.

An advantage of MSMQ independent clients is that they can send messages to public queues while disconnected from the network. The disconnect can be a brief interruption in a network server or the mobile use of a laptop or portable computer, as in the case of a mobile worker like an insurance agent.

MSMQ dependent clients function much like MSMQ independent clients; however, they cannot function without synchronous access to a PEC, PSC, BSC, or MSMQ routing server (referred to as the dependent client's supporting server). MSMQ dependent clients rely on their assigned server to perform all standard MSMQ functions on their behalf (such as creating queues, sending messages, and receiving messages).



Programming Microsoft Visual InterDev 6. 0
Programming Microsoft Visual InterDev 6.0
ISBN: 1572318147
EAN: 2147483647
Year: 2005
Pages: 143

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