1. Field of the Invention
The present invention relates to a method, system, and program for processing a message with dispatchers.
2. Description of the Related Art
In current computing environments, different applications and components may cooperate and communicate to implement a business function. For instance, a group of enterprise and business servers may run various web applications and services that communicate with each other. However, different applications and components may communicate using different message and event formats, which may prevent the applications from working with one another. Moreover, applications typically forward messages based on a destination address or header of the message as generated by the application, which can be limiting. Message brokers exist that allow more loosely coupled communication between components. However, message queues will need to be set up beforehand, and the components need to be aware of these message queues for the communication to take place.
Provided are a method, system, and program for processing a message with dispatchers. A first dispatcher receives a message. The first dispatcher is associated with a first set of criteria. Each criterion in the first set of criteria is associated with one target, and wherein one target comprises a second dispatcher. The first dispatcher processes the message to determine whether there is at least one criterion that the message satisfies. The message is forwarded to the at least one target associated with the at least one determined criterion. The second dispatcher receives the message in response to one determined criterion being associated with the second dispatcher. The second dispatcher is associated with a second set of criteria and each criterion in the second set is associated with one target.
In one embodiment, the criteria 52 may comprise a query that searches the content of the message to determine if the content satisfies certain conditions. The criteria may be expressed using a query language, (such as XPath or XQuery, for messages represented as an XML document or an XML InfoSet). The query criteria may examine the content of the message, or other attributes such as the source application or user that generated the message, the target application or user intended to receive the message, a time, date or priority associated with the message to determine one or more targets to which the message is forwarded. Details of the XQUERY language are described in the publication “XQuery 1.0: An XML Query Language”, Working Draft No. 11 (Copyright W3C, February 2005); details of XPath are described in the publication “XML Path Language (XPath), Version 1.0” (Copyright W3C, 1999). Details of XML InfoSet are described in the publication “XML Information Set (Copyright W3C, 2d Ed., 2004). For instance, the query criteria may examine the content of the message, or other attributes such as the source application or user that generated the message, the target application or user intended to receive the message, a time, date or priority associated with the message to determine one or more targets to which the message is forwarded.
Because a dispatch table 10a, 10b, 10c may have multiple entries, the message 60 may be processed to determine whether it satisfies multiple criteria 52. For each criterion 52 satisfied, the message 6, 60 would be forwarded to the dispatcher 8a, 8b, 8c or application 12a, 12b, 12c identified as the target. This allows multiple applications or targets to register interest in a particular class of events. In embodiments where the message 60 comprises an XML structured document, the criteria 54 may comprise an XQUERY that queries the message 6, 60 to determine whether any XML elements and/or attributes that satisfy the conditions of the query specified by the XQUERY expression.
In one embodiment, the dispatcher 8a, 8b, 8c may sequentially process the dispatch table 10a, 10b, 10c entries and forward the message to the target 54 associated with each satisfied criteria 52. This allows multiple applications or targets to register interest in a particular class of events. In an alternative embodiment, after finding one criteria 52 in one entry that the received message satisfies, the dispatcher 8a, 8b, 8c may cease processing any subsequent entries in the dispatch table 10a, 10b, 10c, so that the message is forwarded to only the target associated with the first satisfied criteria. In another alternative embodiment, the criteria matching could be done in parallel by multiple processor cores or processors to speed up the processing.
At the first dispatcher 204a, if the message 202 satisfies the XQUERY3, then the SOAP message 202 is sent to a WebSphere® portal application 212, which provides an access point to a Web application. (WebSphere is a registered trademark of International Business Machines, Corp.). A portal is a reusable component that provides access to applications, web-based content, and other resources. Web pages, web services, applications, and syndicated content feeds can be accessed through a portal. The WebSphere portal 212 converts the message 202 to a Java call 214 and forwards the message 6 to a portlet 216. In summary, the message will be forwarded to the components and applications based on a set of criteria used by the chain of dispatchers to select applications and components to receive the message. For example, according to
Described embodiments provide a methodology for creating a hierarchical arrangement of dispatchers to allow a message to be processed by the hierarchically arranged dispatchers based on the message content and forward the message to an application associated with the content.
The described operations may be implemented as a method, apparatus or article of manufacture using standard programming and/or engineering techniques to produce software, firmware, hardware, or any combination thereof. The term “article of manufacture” as used herein refers to code or logic implemented in a medium, where such medium may comprise hardware logic (e.g., an integrated circuit chip, Programmable Gate Array (PGA), Application Specific Integrated Circuit (ASIC), etc.) or a computer readable medium, such as magnetic storage medium (e.g., hard disk drives, floppy disks, tape, etc.), optical storage (CD-ROMs, optical disks, etc.), volatile and non-volatile memory devices (e.g., EEPROMs, ROMs, PROMs, RAMs, DRAMs, SRAMs, firmware, programmable logic, etc.). Code in the computer readable medium is accessed and executed by a processor. The medium in which the code or logic is encoded may also comprise transmission signals propagating through space or a transmission media, such as an optical fiber, copper wire, etc. The transmission signal in which the code or logic is encoded may further comprise a wireless signal, satellite transmission, radio waves, infrared signals, Bluetooth, etc. The transmission signal in which the code or logic is encoded is capable of being transmitted by a transmitting station and received by a receiving station, where the code or logic encoded in the transmission signal may be decoded and stored in hardware or a computer readable medium at the receiving and transmitting stations or devices. Additionally, the “article of manufacture” may comprise a combination of hardware and software components in which the code is embodied, processed, and executed. Of course, those skilled in the art will recognize that many modifications may be made to this configuration without departing from the scope of the present invention, and that the article of manufacture may comprise any information bearing medium known in the art.
The terms “an embodiment”, “embodiment”, “embodiments”, “the embodiment”, “the embodiments”, “one or more embodiments”, “some embodiments”, and “one embodiment” mean “one or more (but not all) embodiments of the present invention(s)” unless expressly specified otherwise.
The terms “including”, “comprising”, “having” and variations thereof mean “including but not limited to”, unless expressly specified otherwise.
The enumerated listing of items does not imply that any or all of the items are mutually exclusive, unless expressly specified otherwise.
The terms “a”, “an” and “the” mean “one or more”, unless expressly specified otherwise.
Devices that are in communication with each other need not be in continuous communication with each other, unless expressly specified otherwise. In addition, devices that are in communication with each other may communicate directly or indirectly through one or more intermediaries.
A description of an embodiment with several components in communication with each other does not imply that all such components are required. On the contrary a variety of optional components are described to illustrate the wide variety of possible embodiments of the present invention.
Further, although process steps, method steps, algorithms or the like may be described in a sequential order, such processes, methods and algorithms may be configured to work in alternate orders. In other words, any sequence or order of steps that may be described does not necessarily indicate a requirement that the steps be performed in that order. The steps of processes described herein may be performed in any order practical. Further, some steps may be performed simultaneously.
When a single device or article is described herein, it will be readily apparent that more than one device/article (whether or not they cooperate) may be used in place of a single device/article. Similarly, where more than one device or article is described herein (whether or not they cooperate), it will be readily apparent that a one or any number of devices/articles may be used in place of the more than one illustrated device or article.
The functionality and/or the features of a device may be alternatively embodied by one or more other devices which are not explicitly described as having such functionality/features. Thus, other embodiments of the present invention need not include the device itself.
In
In described embodiments, the target associated with a criteria in a dispatch table entry comprises an application or another dispatcher. In additional embodiments, the target may comprise an Input/Output (I/O) device, such as a printer, storage device, transmission, etc.
The foregoing description of various embodiments of the invention has been presented for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise form disclosed. Many modifications and variations are possible in light of the above teaching. It is intended that the scope of the invention be limited not by this detailed description, but rather by the claims appended hereto. The above specification, examples and data provide a complete description of the manufacture and use of the composition of the invention. Since many embodiments of the invention can be made without departing from the spirit and scope of the invention, the invention resides in the claims hereinafter appended.