This invention relates to computer programming and networking, and more particularly to an automated method and computer apparatus for sending and using self-descriptive objects as messages over a message queuing network.
Users and developers of networked applications and systems desire reliable, faster and easier to use methods of communicating information between source and destination computer applications and operating environments. Traditional messaging techniques require each application to know the specific serialized format of a message, or require communication between the operating environments of the sender and receiver to provide information or meta-data so that the receiver can interpret the message. Computer users and applications developers are desirous of new methods and computer apparatus for communicating messages which decrease the amount of configuration and runtime overhead involved.
Most distributed computing applications today use synchronous communication technologies, such as remote procedure calls. Such synchronous communications require a sender of a request to wait for a response from the receiver of the request before it can proceed and perform other tasks. The time that the sender must wait depends on the time it takes for the receiver to process the request and return a response. Synchronous communication mechanisms also require the sender and the receiver to be operating simultaneously.
In contrast, using asynchronous communications, senders make requests to receivers and can move on to perform other tasks immediately. If a response is expected back from the receiver, it is up to the original sender to decide when it will actually look for and process the response. Most importantly, there is no guarantee that receivers will process requests within any particular period of time. In fact, with asynchronous communications, there are no requirements that receivers be running nor even the communications infrastructure be available in order for a sender to initiate a request.
Message queuing systems implement asynchronous communications by enabling applications to send messages to and receive messages from other applications. These applications may be running on the same machine or on separate machines connected by a network. When an application receives a request message, it processes the request by reading the contents of the message formatted in a known pattern and acting accordingly. If required, the receiving application can send a response message back to the original requester.
Many applications are now using message queuing networks for the enhanced communication delivery reliability between networked computer systems provided by sending messages asynchronously across a message queuing enterprise network. However, these messages are simply received as type-less buffers of raw data that are passed between applications. In some instances, these messages have additional signaling information attached that describe how the message should be sent by the underlying sub-system. However, the messages do not provide any semantic information that enables the message recipient to interpret the meaning of the message contents. To communicate, the source and destination applications rely either on private message content encoding schemes or prior arrangements between the applications to only send messages of a certain type.
According to the invention, an automated method and apparatus are provided for creating, sending, and using self-descriptive objects as messages between applications, and additionally sending these message objects over a message queuing network. Required meta-information is included with these self-descriptive messages making them self-contained and requiring no external components to interpret them. Using the present invention, networked applications can communicate arbitrary objects in a standard way with no prior agreement as to the nature and semantics of message contents. In this manner, applications are more robust and can readily adapt to changes to message contents without having to update the format or structure of the message, or to update the application to interpret the encoded body of a new message format.
In one embodiment of the present invention, messages are sent as serialized dictionary objects over a message queuing network. The dictionary represents an abstract data type defined in terms of four fundamental operations that can be performed on it, namely: add, remove, lookup, and enumerate. These operations correspond to methods invoked to perform the desired operation. As implied by the method names, add( ) adds a specified element to the dictionary; remove( ) removes a specified element in the dictionary; lookup( ) finds a specified element in the dictionary; and enumerate( ) returns one element from the dictionary, allowing the retrieval of all elements from the dictionary.
The dictionary elements, in an embodiment of the present invention, are in the form of a triplet comprised of a Name, Type and Value. The Name represents a string identifier; the Type specifies the type of element which could be as simple as a constant or integer, or be a more complex (and very rich) type such as an Excel spreadsheet or even another serialized data dictionary; and the Value specifies a current value or state of the element. The previously described triplet merely illustrates a very generalized abstract data element. Various other dictionary data elements could be employed in keeping with the present invention.
To enable the dictionary object to be sent across a network, the dictionary object is able to serialize and deserialize itself using two more of its methods. The save( ) method causes the dictionary object to serialize itself to the body of a message, and the load( ) method loads into the object a previously serialized dictionary object located in the body of a received message.
In accordance with the present invention, a sender application creates a persistent dictionary object, and populates the object with the desired contents of the message. The sender application then requests the dictionary object to save or serialize itself into the body of a message queuing message (or the dictionary object could be serialized into a buffer which is copied or moved into the body of a message queuing message prior to sending the message). The message queuing system forwards the message containing the serialized object to the destination queue.
Upon receipt from the destination queue, the receiving message queuing system looks at the received message, and determines that it contains a dictionary object in the body of the message. The destination message queuing system then instantiates and loads the message object with the data dictionary, and passes the object to the recipient application.
The recipient application then uses the dictionary object in any manner it chooses. In one embodiment of a recipient application, the recipient application enumerates the elements of the data dictionary and takes appropriate programming action for each element according to its type. For example, a received Excel spreadsheet in a dictionary element could cause the application to start an Excel application and to forward the value of the element (i.e., the Excel spreadsheet) to the Excel application. Other dictionary elements might contain a single integer, or records containing multiple fields which would be processed accordingly by the recipient application. Thus, the present invention provides a generalized and robust messaging mechanism whereby the sending and receiving applications no longer rely on a previous agreed to protocol format or a specialized serialization scheme.
The appended claims set forth the features of the present invention with particularity. The invention, together with its advantages and as previously described, may be better understood from the following detailed description taken in conjunction with the accompanying drawings of which:
With reference to
A number of program modules may be stored on the hard disk, magnetic disk 29, optical disk 31, ROM 24 or RAM 25, including an operating system 35, one or more application programs 36, other program modules 37, and program data 38. A user may enter commands and information into the personal computer 20 through input devices such as a keyboard 40 and pointing device 42. Other input devices (not shown) may include a microphone, joystick, game pad, satellite dish, scanner, or the like. These and other input devices are often connected to the processing unit 21 through a serial port interface 46 that is coupled to the system bus, but may be collected by other interfaces, such as a parallel port, game port or a universal serial bus (USB). A monitor 47 or other type of display device is also connected to the system bus 23 via an interface, such as a video adapter 48. In addition to the monitor, personal computers typically include other peripheral output devices (not shown), such as speakers and printers.
The personal computer 20 may operate in a networked environment using logical connections to one or more remote computers, such as a remote computer 49. The remote computer 49 may be another personal computer, a server, a router, a network PC, a peer device or other common network node, and typically includes many or all of the elements described above relative to the personal computer 20, although only a memory storage device 50 has been illustrated in
When used in a LAN networking environment, the personal computer 20 is connected to the local network 51 through a network interface or adapter 53. When used in a WAN networking environment, the personal computer 20 typically includes a modem 54 or other means for establishing communications over the wide area network 52, such as the Internet. The modem 54, which may be internal or external, is connected to the system bus 23 via the serial port interface 46. In a networked environment, program modules depicted relative to the personal computer 20, or portions thereof, may be stored in the remote memory storage device. It will be appreciated that the network connections shown are exemplary and other means of establishing a communications link between the computers may be used.
The present invention provides for sending self-descriptive message objects as messages between two or more applications, and operates in any computing environment that supports data objects, whether on a standalone computer or preferably in a networked environment. Using self-descriptive objects as messages, a recipient no longer relies on a convention or a special-coding serialization scheme. The recipient application can simply extract a data element from the received object in a standard, well-known way, discover the element's logical type, and take appropriate programmatic action.
The present invention is described in the context of a Microsoft Message Queue Server (MSMQ) network and using Microsoft Component Object Model (COM) objects in order to illustrate one embodiment of the invention. The present invention is not so limited, as the teachings disclosed herein provide for the present invention to be used in other messaging systems and communications networks, as well as using other forms of objects and self-descriptive structures.
A brief introduction of message queuing is provided below. A more detailed explanation of MSMQ is described in “Microsoft Message Queue Server (MSMQ),” MSDN Library—April 1998, Microsoft Corporation, and is hereby incorporated by reference. And a detailed explanation of COM is described in described in “COM and ActiveX Object Services,” MSDN Library—April 1998, Microsoft Corporation, and is hereby incorporated by reference.
MSMQ implements asynchronous communications by enabling applications to send messages to, and receive messages from, other applications. These applications may be running on the same machine or on separate machines connected by a network. MSMQ messages can contain data in any format that is understood by both the sender and the receiver. When an application receives a request message, it processes the request by reading the contents of the message and acting accordingly. If required, the receiving application can send a response message back to the original requester.
While in transit between senders and receivers, MSMQ keeps messages in holding areas called queues, hence the name message queuing. MSMQ queues protect messages from being lost in transit and provide a place for receivers to look for messages when they are ready. Applications make requests by sending messages to queues associated with the intended receiver. If senders expect responses in return, they must include the name of a response queue (that the sender must create in advance) in all requests that they make to the receiver.
Turning now to
A message queuing enterprise network can span many locations and operate on top of different transport network protocols. The topology of the message queuing enterprise network can be described in terms of (1) physical location and (2) communication protocol connectivity. The term “site” describes an aspect of the enterprise network based on a physical location. In contrast, a “connected network” describes an aspect of the message queuing enterprise network according to communication protocol connectivity.
An enterprise network is a collection of sites connected through slow/expensive network connections. A site, is a physical collection of machines, where communication between two machines is cheap and fast. These two computers are typically located in the same physical location, although not required. The concept of a site is integral to the message routing algorithm employed by the message queuing system. In order to route messages throughout the message queuing enterprise network, a message queuing computer must be able to locate the destination message queue. A subset of computers within the message queuing network are also directory servers (“DS servers”) which maintain message queuing information, including information to enable routing of messages such as sites, connected networks, and names of DS servers within the message queuing network.
A MSMQ network is a collection of addresses “speaking” several communication protocols and are connected by physical communication links. A connected network is a collection of addresses, where every two addresses can communicate directly (i.e., the underlying communication network provides the connection if all its components are on-line). Inside a connected network, communication delay and cost may vary. The physical communication lines and the traffic overhead define the communication delay and cost. Two addresses in a connected network may be connected by a fast, cheap line, for example, if their machines are in the same site or by a slow expensive line if their machines are in different sites. Two machines belong to the same connected network if they support the same protocol, and can have a direct session on that protocol. A machine can support more than one connected network on a specific protocol if it supports more than one address which belong to different connected networks on a specific protocol. A connected network does not consist of more than one protocol.
These concepts are further illustrated in
Turning now to
In one embodiment of the present invention, messages are sent as serialized dictionary objects over a message queuing network. The dictionary represents an abstract data type defined in terms of four fundamental operations that can be performed on it, namely: add, remove, lookup, and enumerate; with the addition of two operations to serialize and unserialize the persistent dictionary object to enable the dictionary object to be sent across a network.
Turning now to
The dictionary elements, in an embodiment of the present invention, are in the form of a triplet comprised of a Name, Type and Value. The Name represents a string identifier; the Type specifies the type of element which could be as simple as a constant or integer, or be a more complex (and very rich) type such as an Excel spreadsheet or even a serialized data dictionary; and the Value specifies a current value or state of the element. In an embodiment, the type field contains an agreed upon indicator specifying the type of element (e.g., 1 is an integer, 2 is a string, 3 is an object, etc.). In another embodiment, the type mechanism is extended to provide a standard way for receivers to learn about type indicators that the receiver does not recognize such as by querying the sending application, the message queuing network, or some other local or remote process.
For example, a record of data such as an address book entry could be sent as a persistent dictionary object, with the address book entries being defined in terms of two dictionary elements. The first dictionary element having a Name of “Entry Name”, being of Type “string”, and having a Value of “USPTO”; with the second dictionary element having a Name of “City”, being of Type “string”, and having a Value of “Washington D.C.”. Using Visual Basic and dimensioning d as a New PersistentDictionary, the elements could be added to d using the statements:
Using the previously described triplet as a data element merely illustrates a very generalized abstract data element. Various other dictionary data elements could be employed in keeping with the present invention. In addition, late binding techniques could be used to make each named element in the data dictionary a data member of the object. Using this technique, elements of the dictionary could be referenced directly. For example, a data element msword_document in a dictionary d could be referenced as d.msword_document as opposed to d(“msword_document”).
Turning now to
First, turning to
Next, turning to
Otherwise, if the message object supports persistence as determined in step 505, then the required size of a buffer is determined and allocated in step 510 to accommodate the serialized message object. Next, in step 515, the persistent storage type supported by the message object is determined. If the message object supports streams, then processing flows to steps 520-525 wherein the message object writes itself to the buffer, and the message type is set to a “streamed object”. Otherwise, the message object supports storage (the other storage type for a COM object) and processing continues with steps 530-535 wherein a storage pointing to the message buffer is created, the object saves itself to the storage (i.e., the message buffer), and the message type is set to a “stored object”. Finally, in step 540, the MSMQ message body is set to the contents of the buffer and the MSMQ server forwards the message to the destination queue.
When such a message object is received at a receiving MSMQ server queue and the message has been determined to contain an object by querying the message itself using a method of the message, the message is processed according to the flow diagram of
Next, in step 580, the OLE interface CoCreateInstance is used to instantiate the message object (i.e., the persistent dictionary object). Then, the load method 322 (
The recipient application then uses the received self-contained message object as described herein with reference to the flow diagram of
The remaining steps 465-499 illustrate one embodiment of such processing. First, if the body of the received message is not a persistent dictionary as determined in step 465, then the non-persistent data object (e.g., an integer, record, string) is processed by the application. For example, the recipient application could print the address book previously described herein by setting d to the message body of a received message containing an address book entry, and then using the statement:
Otherwise, the received message is a persistent dictionary as determined in step 465, and d is set to the message body in step 470. Next, while there are elements remaining in the persistent dictionary d, steps 477-495 are performed for each element. In step 477, an element is enumerated from the data dictionary. Next, steps 480-495 are performed which embody a case statement switching upon the typeof( ) the element (i.e., the type of the persistent dictionary element received in the MSMQ message). For example, if the type of the element is an Excel spreadsheet, then Excel operations are performed. Otherwise, processing continues in the case statement with a generic type “CaseType” provided for illustrative purposes in steps 490, 495 to signify the diverse and rich types of elements that can be sent across a network in a self-descriptive message using the present invention. This CaseType could be any data type, including an integer, string, data record, address book entries, or even a persistent dictionary. Many different configurations are also possible, including the recipient application being a CaseType application and processing the received element, or a CaseType application being invoked by the recipient application or message queuing system to process the received the data element.
In view of the many possible embodiments to which the principles of our invention may be applied, it will be appreciated that the embodiment described herein with respect to the drawing figures is only illustrative and should not be taken as limiting the scope of the invention. To the contrary, the invention as described herein contemplates all such embodiments as may come within the scope of the following claims and equivalents thereof.
This application is continuation of application Ser. No. 09/114,231 filed Jun. 30, 1998, now U.S. Pat. No. 6,848,108, the contents of which are incorporated by reference.
Number | Name | Date | Kind |
---|---|---|---|
4499576 | Fraser | Feb 1985 | A |
4584679 | Livingston et al. | Apr 1986 | A |
4623886 | Livingston | Nov 1986 | A |
4656474 | Mollier et al. | Apr 1987 | A |
4736369 | Barzilai et al. | Apr 1988 | A |
4769815 | Hinch et al. | Sep 1988 | A |
5063562 | Barzilai et al. | Nov 1991 | A |
5163131 | Row et al. | Nov 1992 | A |
5193090 | Filipiak et al. | Mar 1993 | A |
5247676 | Ozur et al. | Sep 1993 | A |
5257369 | Skeen et al. | Oct 1993 | A |
5285445 | Lehnert et al. | Feb 1994 | A |
5287103 | Kasprzyk et al. | Feb 1994 | A |
5317736 | Bowen | May 1994 | A |
5327559 | Priven | Jul 1994 | A |
5361351 | Priven et al. | Nov 1994 | A |
5367523 | Chang et al. | Nov 1994 | A |
5422999 | Travis et al. | Jun 1995 | A |
5465328 | Dievendorff et al. | Nov 1995 | A |
5526358 | Gregerson et al. | Jun 1996 | A |
5526489 | Nilakantan et al. | Jun 1996 | A |
5546391 | Hochschild et al. | Aug 1996 | A |
5555415 | Allen | Sep 1996 | A |
5557748 | Norris | Sep 1996 | A |
5572522 | Calamvokis et al. | Nov 1996 | A |
5572582 | Riddle | Nov 1996 | A |
5627766 | Beaven | May 1997 | A |
5754849 | Dyer et al. | May 1998 | A |
5758184 | Lucovsky et al. | May 1998 | A |
5761507 | Govett | Jun 1998 | A |
5764625 | Bournas | Jun 1998 | A |
5768532 | Megerian | Jun 1998 | A |
5777987 | Adams et al. | Jul 1998 | A |
5778384 | Provino et al. | Jul 1998 | A |
5793861 | Haigh | Aug 1998 | A |
5793965 | Vanderbilt et al. | Aug 1998 | A |
5812819 | Rodwin et al. | Sep 1998 | A |
5815667 | Chien et al. | Sep 1998 | A |
5819042 | Hansen | Oct 1998 | A |
5828653 | Goss | Oct 1998 | A |
5832219 | Pettus | Nov 1998 | A |
5835727 | Wong et al. | Nov 1998 | A |
5838907 | Hansen | Nov 1998 | A |
5845081 | Rangarajan et al. | Dec 1998 | A |
5854901 | Cole et al. | Dec 1998 | A |
5864669 | Osterman et al. | Jan 1999 | A |
5872968 | Knox et al. | Feb 1999 | A |
5875301 | Duckwall et al. | Feb 1999 | A |
5875306 | Bereiter | Feb 1999 | A |
5878056 | Black et al. | Mar 1999 | A |
5881051 | Arrowood et al. | Mar 1999 | A |
5901138 | Bader et al. | May 1999 | A |
5916307 | Piskiel et al. | Jun 1999 | A |
5920697 | Masters et al. | Jul 1999 | A |
5922049 | Radia et al. | Jul 1999 | A |
5922054 | Bibayan | Jul 1999 | A |
5930479 | Hall | Jul 1999 | A |
5956340 | Afek et al. | Sep 1999 | A |
6035303 | Baer et al. | Mar 2000 | A |
6052711 | Gish | Apr 2000 | A |
6064816 | Parthasarathy et al. | May 2000 | A |
6101556 | Piskiel et al. | Aug 2000 | A |
6128621 | Weisz | Oct 2000 | A |
6202089 | Juster | Mar 2001 | B1 |
6205498 | Habusha et al. | Mar 2001 | B1 |
6209040 | Acton et al. | Mar 2001 | B1 |
6226666 | Chang et al. | May 2001 | B1 |
6256634 | Moshaiov et al. | Jul 2001 | B1 |
6272521 | Jablonski et al. | Aug 2001 | B1 |
6275912 | Haba | Aug 2001 | B1 |
6446144 | Habusha et al. | Sep 2002 | B1 |
6446206 | Feldbaum | Sep 2002 | B1 |
6529932 | Dadiomov et al. | Mar 2003 | B1 |
6564377 | Jayasimha et al. | May 2003 | B1 |
6678726 | Moshaiov | Jan 2004 | B1 |
Number | Date | Country | |
---|---|---|---|
20050071316 A1 | Mar 2005 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 09114231 | Jun 1998 | US |
Child | 10992461 | US |