Abstract:
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.

Description:
BACKGROUND OF THE INVENTION  
       [0001]     1. Field of the Invention  
         [0002]     The present invention relates to a method, system, and program for processing a message with dispatchers.  
         [0003]     2. Description of the Related Art  
         [0004]     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.  
       SUMMARY  
       [0005]     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. 
     
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0006]      FIGS. 1 and 2  illustrate embodiments of components in a computing environment.  
         [0007]      FIG. 3  illustrates an embodiment of a dispatch table entry.  
         [0008]      FIG. 4  illustrates an embodiment of message content.  
         [0009]      FIG. 5  illustrates an embodiment of operations to process a message with one or more dispatchers.  
         [0010]      FIG. 6  illustrates an embodiment of operations to have an adapter convert a message being forwarded to a target application.  
         [0011]      FIG. 7  illustrates an embodiment of an arrangement and interactions between dispatchers and applications. 
     
    
     DETAILED DESCRIPTION  
       [0012]      FIG. 1  illustrates a computing environment  2  including an event source  4  that generates an event/message  6  that is sent to a first dispatcher  8   a . The first dispatcher  8   a  may forward a message according to a dispatch table  10   a  to zero or more specified applications  12   a ,  12   b ,  12   c  or zero or more of additional dispatchers  8   b ,  8   c . Dispatchers  8   b ,  8   c  forward a message to an application  12   a ,  12   b ,  12   c  or another dispatcher, such as  8   b ,  8   c  or other dispatchers not shown, according to their respective dispatch tables  10   b ,  10   c . Further, if the received message  6  is in a format not understood by the application  12   a  to which the message  6  is forwarded, then an adaptor  14  associated with the application  12   a  would translate the forwarded message to and from a format understood by the application  12   a . For instance, if the message is in the Simple Object Access Protocol (SOAP), then the message may be forwarded by one dispatcher  8   a ,  8   b ,  8   c  to an application  12   a  that only supports message in a different format, such as the Java Messaging Service (JMS). (Java is a trademark of Sun Microsystems, Inc.) In such case, the adaptor  16  will convert the message  6  from the format of the event source  4 , e.g., SOAP, to a format compatible with the application  10   a  to which the message is forwarded, such as JMS.  
         [0013]      FIG. 2  illustrates the hardware components of a network computing environment  2  in which the components, e.g., dispatchers  8   a ,  8   b ,  8   c , applications  12   a ,  12   b ,  12   c  and dispatch tables  10   a ,  10   b ,  10 , c  of  FIG. 1  may be implemented. A plurality of systems  20   a ,  20   b ,  20   c  communicate via a network  22 . Each system  20   a ,  20   b ,  20   c  may include any number of applications  12   a ,  12   b ,  12   c  and/or dispatchers  8   a ,  8   b ,  8   c . As shown with respect to system  20   b , each system may include a processor  24  and a memory  26  in which one or more applications  12   a ,  12   b ,  12   c  and/or dispatchers  8   a ,  8   b ,  8   c  are loaded and run. In an alternative embodiment, all the components, e.g., dispatchers  8   a ,  8   b ,  8   c , applications  12   a ,  12   b ,  12   c  and dispatch tables  10   a ,  10   b ,  10 , c  of  FIG. 1  may be implemented in a single system or enclosure and communicate via shared memory.  
         [0014]      FIG. 3  illustrates an embodiment of an entry  50  in any of the dispatch tables  10   a ,  10   b ,  10   c , including a criteria  52  and a target  54 . The criteria indicates a condition or query, such that if the message content, headers, and/or attributes satisfy the criteria, e.g., condition or query, then that message is forwarded to the indicated target  54 , where the target may comprise an application  12   a ,  12   b ,  12   c , another dispatcher  8   a ,  8   b ,  8   c , a device, etc. In this way, dispatchers may be arranged in a hierarchical fashion such that parent dispatchers forward messages to child dispatchers if the message satisfies the criteria associated with the target. Further, with the described embodiments, a message is processed according to a hierarchical tree structure, where at each level of the hierarchy, a dispatcher determines whether the message satisfies the criterion associated with each target registered with the dispatcher, i.e., the criterion in the dispatch table  10   a ,  10   b ,  10   c  entries. Yet further, the designer of the hierarchical arrangement of dispatchers may partition events and messages into logical subsets, by having different sets of dispatchers handle each event or message subset, as specified by the criteria or matching rule associated with the dispatchers (and their parents).  
         [0015]      FIG. 4  illustrates an embodiment of the message  6  in the form of a structured document  60 . Message  60  has one or more elements  62   a  . . .  62   n  and each element has zero or more attributes  64   a  . . . .  64   n  and  66   a  . . . .  66   n . In this way, the message  60  comprises a hierarchical arrangement of elements  62   a  . . .  62   n , where each element may provide a type of information and attributes of that element providing properties of the element content. Elements and attributes may be delimited by start and end tags, or for empty elements an empty element tag, with the content, name or other information between the start and end tags. For instance, message  60  may have elements providing the content of the message and other elements and attributes providing additional information and properties about the message, such as the source, target application for which the message is intended, source application that generated the message, etc. The message  60  may comprise an Extensible Markup Language (XML) document. Details of the XML language are described in the publication “Extensible Markup Language (XML) 1.0 (Third Edition)” (Copyright W3C, 2004).  
         [0016]     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.  
         [0017]     Because a dispatch table  10   a ,  10   b ,  10   c  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  8   a ,  8   b ,  8   c  or application  12   a ,  12   b ,  12   c  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.  
         [0018]      FIG. 5  illustrates operations performed by a dispatcher  8   a ,  8   b ,  8   c  in response to receiving a message  6 ,  60  from the event source  4  or another dispatcher  8   a ,  8   b ,  8   c . The event source  4  may comprise an application  12   a ,  12   b ,  12   c . Upon one dispatcher  8   a ,  8   b ,  8   c  receiving (at block  100 ) the message  6 , the dispatcher  8   a ,  8   b ,  8   c  performs the operations at blocks  102  through  110  for each entry  50  in the dispatch table  10   a ,  10   b ,  10   c  associated with the receiving dispatcher  8   a ,  8   b ,  8   c . The dispatcher  8   a ,  8   b ,  8   c  determines (at block  104 ) the criteria  52  for the entry  50  being processed. If (at block  106 ) the message content (e.g., content in any element  62   a ,  62   n  and/or attribute  64   a  . . .  64   n ,  66   a  . . .  66   n ) satisfies the criteria  52 , i.e., satisfies the XQUERY if the message  60  comprises an XML document, then the message  6 ,  60  is forwarded (at block  108 ) to the target  54  (application  12   a ,  12   b ,  12   c  or dispatcher  8   a ,  8   b ,  8   c ) associated with the criteria  52 , which is the target  54  identified in the entry  50  being processed. After forwarding the message  6 ,  60  (at block  108 ) or if (at block  106 ) the message  6  does not satisfy the criteria  52 , then control proceeds back to block  102  to process a next entry  50  in the dispatch table  10   a ,  10   b ,  10   c . After processing all entries  50  in the dispatch table  10   a , control ends. If the message is forwarded to another dispatcher, i.e., a child dispatcher, then that child dispatcher would perform the operations of  FIG. 5  to process the message.  
         [0019]     In one embodiment, the dispatcher  8   a ,  8   b ,  8   c  may sequentially process the dispatch table  10   a ,  10   b ,  10   c  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  8   a ,  8   b ,  8   c  may cease processing any subsequent entries in the dispatch table  10   a ,  10   b ,  10   c , 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.  
         [0020]      FIG. 6  illustrates an embodiment of operations performed when the message  6  is in a first format that is not compatible with a second format used by the application  12   a ,  12   b ,  12   c . Upon forwarding ( 150 ) a message  6 ,  60 , if (at block  152 ) the application is capable of processing messages in the first format used by the event source  4 , then the target application  12   a ,  12   b ,  12   c  processes (at block  154 ) the message  6 ,  60  in the first format. Otherwise, if the first format is not compatible with the target application  12   a ,  12   b ,  12   c , then an adaptor  14  is called (at block  156 ) to convert the message  6 , e.g., in XML, to a second format, e.g., JMS, used by the application  12   a ,  12   b ,  12   c . In one embodiment, the dispatcher  8   a ,  8   b ,  8   c  may call the adaptor  14 . In another embodiment, the application  12   a ,  12   b ,  12   c  may call the adaptor  14 . Further, the adaptor  14  may be part of the dispatcher in order to convert the message to the proper format before forwarding to the application. The application  12   a ,  12   b ,  12   c  processes (at block  158 ) the converted message in the compatible format. Similarly, an adapter  14  can be placed between the event source  4  and the first dispatcher  8   a  to convert an alternative message type into the canonical format that the dispatchers  8   a ,  8   b ,  8   c  are designed to handle. In this manner, different message types can be handled, while at the same time, the dispatch system be kept simple and focus on a single message type.  
         [0021]      FIG. 7  illustrates one embodiment of a dispatch environment. An event source  200  forwards a SOAP message  202  to a first dispatcher  204   a  having a dispatch table  206   a  of three XQUERY/target entries. For instance, satisfying XQUERY1 will result in the message  202  being forwarded to a Customer Information Control System (CICS)  208 , which is an application server that provides industrial-strength, online transaction management and connectivity for mission-critical applications. If the message  202  satisfies XQUERY2, then the message is forwarded to a second dispatcher  204   b  having a dispatch table  206   b  with one entry having XQUERY4. If the SOAP message  202  satisfies XQUERY4, then the second dispatcher  206   b  converts the message to a Hypertext Transport Protocol (HTTP) invocation  208  that is sent to a web application  210 .  
         [0022]     At the first dispatcher  204   a , 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  FIG. 7 , a message satisfying both XQuery 2  and XQuery 4  in dispatchers  204   a  and  204   b  is forwarded to “Web App  4 ”  210 . Depending on how the system is set up, the message can be forwarded to all the components that match the message, or the first component that is found.  
         [0023]     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.  
       Additional Embodiment Details  
       [0024]     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.  
         [0025]     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.  
         [0026]     The terms “including”, “comprising”, “having” and variations thereof mean “including but not limited to”, unless expressly specified otherwise.  
         [0027]     The enumerated listing of items does not imply that any or all of the items are mutually exclusive, unless expressly specified otherwise.  
         [0028]     The terms “a”, “an” and “the” mean “one or more”, unless expressly specified otherwise.  
         [0029]     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.  
         [0030]     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.  
         [0031]     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.  
         [0032]     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.  
         [0033]     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.  
         [0034]     In  FIGS. 5 and 6 , certain operations were described as performed by a configuration method or a device driver. In alternative embodiments, certain operations described as performed by the configuration method may be performed by the device driver and operations described as performed by the device driver may be performed by the configuration method.  
         [0035]     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.  
         [0036]     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.