SAS IT technology (interact with MSMQ)

zhaozj2021-02-16  155

MSMQ

Introduction

MSMQ is the abbreviation of Microsoft Message Queuing Service, and Microsoft Message Queue Services. MSMQ technology provides a model based on messages and queues of loosely coupled and very reliable applications. Currently Windows 2000, Windows XP, and Windows NT support MSMQ.

MSMQ uses asynchronous communication technology to send and accept messages. Therefore, to understand the MSMQ technology, you must first understand the concept of asynchronous communication contractual communication. Synchronous communications, such as calling, messaging, and acceptance is real-time, the sender of the message must wait for the acceptor to respond before doing other tasks, the sender's waiting time depends on the time and network of the acceptor processing. Asynchronous communications, such as sending email, document printing, the sender of the message can immediately perform other tasks immediately, regardless of whether the recipient has been handled or responding, as for the acceptor response, How to send the sender and when processed is determined by the sender.

If you run asynchronous communication between applications running on the same computer or different computers, MSMQ is a good choice, which guarantees that the message is reliable and accepted. The MSMQ message can support various data types that can make the various basic data types such as characters, numbers, and the like, can also customize the user-defined data type. The format of the message can be an XML format or a binary format, or an ActiveX message format. In addition, MSMQ also supports transactional processing.

SAS and MSMQ interaction, SAS website is as follows:

MSMQ Interface

Writing MSMQ Applications

With MSMQ messaging, two or more applications communicate with each other indirectly and asynchronously using message queues. The applications do not have to be running at the same time or even in the same operating environment. An application wishing to communicate with another application simply sends a Message to a queue. The Receiving Application Retrieves The Message When ITY.

A Typical Sas Program Using MSMQ Services Performs The Following Tasks:

A program must first either open an existing queue or create a new queue. A function is available to help find queues based on their property values. If opening an existing queue, the program supplies a queue identifier to select the appropriate queue. If creating a new queue, a queue identifier is returned to the program to be used in subsequent calls. The queue identifier is used by MSMQ in a distributed database that maintains information about users, queues, queue managers, host machines, and network layout. This database is referred to as the MSMQ Information Store (MQIS) and helps to insulate the application developer from the details of the network. When creating a queue, you can declare it public or private. public queues are registered in the MQIS and can be accessed throughout the NetWork, Private Queues, On The Other Hand, Can Be Accessed Only by Systems That Know The Queue '

s full path name or format name. Other properties can be set when creating a queue such as security, message handling, and types of services provided by the queue. These same types of properties can also be retrieved from or set on a queue that has been opened. A program that has opened a queue can compose and send a message. to compose a message, a function is used to identify a data map which describes the format, the number and the type of parameters to be sent as part of the message. The data map is used by a function that creates a data descriptor of the actual values ​​of the SAS variables to be included in the message. If your distributed application uses a Microsoft Transaction Server (MTS), a transaction object can be used to send the message based on the success of the transaction. A program can also retrieve messages from an opened queue. MSMQ uses the concept of a cursor to identify the location of the message within a queue. A message can be read from the current cursor loca tion or you can peek at the next location. When a message is read, the program can elect to remove the message or leave it on the queue. In addition, a number of message properties such as security issues, size, identification, and statistics on the delivery can also be retrieved After a program has sent or retrieved all its messages, queues can also be closed or deleted This releases the resources allocated when the queue was opened or created.Note:.. MSMQ uses several different representations to identify a Queue, Such As Format Name, PathName, Instance GUID, AND Queue Handle. There Are Functions Available That You Can Use to Convert Between Repensentations.

MSMQ Interface

Copyright © 2004 SAS Institute Inc. All Rights Reserved.

转载请注明原文地址:https://www.9cbs.com/read-8611.html

New Post(0)