Abstract:
A client computer batch message transaction group is created that includes a set of client computers from which messages are committed as a batch messaging transaction to a single message reception queue. In response to receiving separate messages from at least two of the set of client computers within the client computer batch message transaction group, the separate messages are grouped under the batch messaging transaction as a single unit of work to commit to the single message reception queue. A single batch transaction commit decision is computed based upon whether a write of each of the separate messages grouped within the single unit of work to the single message reception queue is successful.

Description:
BACKGROUND 
       [0001]    The present invention relates to a method for processing a unit of work. 
         [0002]    In some edge connectivity scenarios it is necessary to connect a large number, typically tens of thousands, of client computers. These client computers may need to perform updates to a server which are persistent, for example, reliably delivering messages to or from the server. 
         [0003]    Typically, one thread per client waits for work from the client and when work is received, the server performs a disk force in a transaction specific to the client. 
         [0004]    Disk forces are expensive in that they cause delay and this problem is compounded when disk forces occur for work from multiple client computers. The system software may try to merge several disk forces together to mitigate this, at a cost of having to manage the merging of disk forces. 
         [0005]    Further, this mechanism requires many threads to be active. 
         [0006]    Both problems inhibit scalability, especially in the case where there are many (e.g., tens of thousands) client computers. 
       SUMMARY 
       [0007]    A method for processing a unit of work includes creating, at a server computer, a client computer group by selecting a subset of a plurality of client computers, where each of the plurality of client computers has a separate communication channel with the server computer; receiving a message from at least one of the subset of the plurality of client computers at the server computer; in response to receiving messages from at least two of the subset of the plurality of client computers within the client computer group, grouping the messages under a single unit of work; and computing a single decision associated with the single unit of work for the client computer group, where each of the at least two of the subset of the plurality of client computers is operable to accept the single decision. 
         [0008]    An apparatus for processing a unit of work includes a network interface and a processor programmed to create a client computer group by selecting a subset of a plurality of client computers, where each of the plurality of client computers has a separate communication channel with the apparatus via the network interface; receive a message from at least one of the subset of the plurality of client computers at the apparatus via the network interface; responsive to receiving messages from at least two of the subset of the plurality of client computers within the client computer group, group the messages under a single unit of work; and compute a single decision associated with the single unit of work for the client computer group, where each of the at least two of the subset of the plurality of client computers is operable to accept the single decision. 
         [0009]    A computer program product includes a computer readable storage medium including computer readable program code, where the computer readable program code when executed on a computer causes the computer to create a client computer group by selecting a subset of a plurality of client computers, where each of the plurality of client computers has a separate communication channel with the computer; receive a message from at least one of the subset of the plurality of client computers at the computer; in response to receiving messages from at least two of the subset of the plurality of client computers within the client computer group, group the messages under a single unit of work; and compute a single decision associated with the single unit of work for the client computer group, where each of the at least two of the subset of the plurality of client computers is operable to accept the single decision. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0010]    The present subject matter will now be described, by way of example only, with reference to preferred embodiments thereof, as illustrated in the following drawings: 
           [0011]      FIG. 1  is a block diagram of an example of an implementation of a system according to an embodiment of the present subject matter; 
           [0012]      FIG. 2  is an additional block diagram of the system of  FIG. 1  depicting several client computers having queues, operable to communicate with the server computer according to an embodiment of the present subject matter; and 
           [0013]      FIG. 3  is a flow chart an example of an implementation of a process operable at a server device to perform processing associated with several client computer devices according to an embodiment of the present subject matter. 
       
    
    
     DETAILED DESCRIPTION 
       [0014]      FIG. 1  is a block diagram of an example of an implementation of a system ( 100 ) in which the preferred embodiment may be implemented. There is shown a client computer ( 105 ) having a client application ( 110 ) including an associated queue ( 115 ) and a client middleware application ( 120 ) operable to manage the queue ( 115 ). In an example, the client computer ( 105 ) may include an electricity meter and the client application ( 110 ) is an application that produces messages including electricity readings. 
         [0015]    It should be understood that, alternatively, the client application ( 110 ) may not have an internal queue. Rather, the production and consumption of messages associated with the client application ( 110 ) may be synchronous with a server application. 
         [0016]    The client computer ( 105 ) is operable to communicate with a server computer ( 130 ) using a network ( 125 ). The server computer ( 130 ) executes a server application ( 145 ) including an associated queue ( 140 ) and a server middleware application ( 135 ) operable to manage the queue ( 140 ). In an example, the server application ( 145 ) may include an application that consumes messages including electricity readings and responsively produces messages including, for example, an instruction (e.g., “shut down”) to an appliance associated with the electricity meter. 
         [0017]    There are typically three transactions involved in transferring messages from one system to another. With reference to  FIG. 1 , “Transaction 1 ” is associated with the client application ( 110 ) storing a message on its associated queue ( 115 ) (e.g., where the queue ( 115 ) is local to the client application ( 110 )). “Transaction  2 ” is associated with the transfer of the message from the client computer ( 105 ) to the server computer ( 130 ) using the network ( 125 ). It should be noted that Transaction  2  is not under the direct control of the client application ( 110 ) within the present example. “Transaction  3 ” is associated with receipt of the message at the server computer ( 130 ) in its associated queue ( 140 ) (e.g., where the queue ( 140 ) is local to the server computer ( 130 )). 
         [0018]    The preferred example is directed to processing associated with Transaction  2  as will be described herein. 
         [0019]      FIG. 2  is an additional block diagram of the system ( 100 ) of  FIG. 1  depicting several client computers having queues, operable to communicate with the server computer ( 130 ). With reference to  FIG. 2 , in use, there may be several (e.g., tens of thousands) of client computers ( 105 ) having queues, operable to communicate with the server computer ( 130 ). 
         [0020]      FIG. 3  is a flow chart an example of an implementation of a process  300  operable at a server device, such as the server computer ( 130 ), to perform processing associated with several (e.g., tens of thousands) client computer devices, such as the client computers ( 105 ). With reference to  FIG. 3 , the transaction flows associated with a message inbound to the server computer ( 130 ) is shown. 
         [0021]    In a pre-processing step, a number of client applications ( 110 ) may connect to the server middleware application ( 135 ), wherein each client application ( 110 ) has its own, separate communications channel and wherein each client application ( 110 ) sends a client identifier to the server middleware application ( 135 ). 
         [0022]    At step  301 , the server middleware application ( 135 ) creates a group of client applications by selecting a number of connected client applications ( 110 ). 
         [0023]    The server middleware application ( 135 ) stores client identifiers and associated queue ( 115 ) identifiers of the selected client applications ( 110 ). 
         [0024]    In one example, the group is created using any number of client applications ( 110 ). Preferably, a threshold value associated with a number of groups is selected and the number of connected client applications ( 110 ) is divided among the threshold value of the number of groups. 
         [0025]    Preferably, a single thread associated with the server middleware application ( 135 ) is assigned to the group. 
         [0026]    Each client application ( 110 ) in the group may produce one or more messages which are written to the associated queues ( 115 ). 
         [0027]    Each client middleware application ( 120 ) takes a copy of the message from the queue ( 115 ). The message may be deleted from the queue ( 115 ) at this point or after acknowledgement of its receipt by the server computer ( 130 ), depending on the quality of service required for delivery of the message. 
         [0028]    Next, the client middleware application ( 120 ) sends an update request (step  305 ) (that is, a request that makes a change to a resource manager), to each associated queue ( 115 ) of the client applications ( 110 ) that are in the group. 
         [0029]    In response to the update request, messages that are present on each queue ( 115 ) are copied to an associated buffer, ready for sending across the network ( 125 ) to the server computer ( 130 ). 
         [0030]    Each client middleware application ( 120 ) sends an associated message to the server computer ( 130 ) across the network ( 125 ). 
         [0031]    The server computer ( 130 ) receives multiple messages from a number of different client applications ( 110 ). In response to receipt of the multiple messages, the server middleware ( 135 ) batches (step  310 ) the multiple requests under the single Transaction  2 . 
         [0032]    Any client application ( 110 ) that produces work shares a transaction with each of the other client applications in its group that have also performed some work. Each client application ( 110 ) in the group accepts a single outcome of the transaction. 
         [0033]    The server middleware ( 135 ) writes each message to the queue ( 140 ) and a decision associated with the transaction is computed (step  315 ). In an example, the decision may be based on whether the write to the queue ( 140 ) succeeds. 
         [0034]    In response to a decision being computed, if the decision is to commit the transaction (positive outcome to step  320 ), an acknowledgement identifying the commit decision is sent (step  325 ) to each client application ( 110 ) in the group. 
         [0035]    If the decision is to rollback the transaction (negative outcome to step  320 ), an acknowledgement identifying the rollback decision is sent (step  330 ) to each client application ( 110 ) in the group. In an alternative implementation, if the decision is rollback, an acknowledgement identifying the rollback decision is sent (step  330 ) to the individual client whose message was not written to the queue ( 140 ). In another alternative implementation, the rollback decision may be indicated by terminating each client application&#39;s (or an individual client application&#39;s) ( 110 ) connection. 
         [0036]    The transaction coordinator forces a write of the disk in order to log the decision. It should be noted that this may be computationally intensive. In contrast to conventional processing where this disk write had to occur on a per client basis causing enormous delay, the present subject matter associates the disk write with work undertaken by a group of client applications, thereby providing improved efficiency. 
         [0037]    A symmetrical process is followed for transmission of messages from the server computer ( 130 ) to the client computer ( 105 ). Any combination of the delivery and confirmation flows for send and receipt of messages may be combined in a shared transaction in the server computer ( 130 ). 
         [0038]    The decision of the transaction is executed on behalf of each client in the group. 
         [0039]    The transaction associated with the group will fail if any one of the queues ( 115 ) in the group is not able to successfully participate in the transaction. Thus, although the present invention sacrifices some transaction isolation, for example by grouping client computers such that work from across a set of client applications is obtained and processed or assigning as a single thread to a group, the present subject matter achieves scalability in a scenario where there are several (e.g., tens of thousands of) client computers. 
         [0040]    Advantageously, the transaction that is initiated is not under the influence of a client application ( 110 ). This prevents a client application ( 110 ) from choosing, at any time, to rollback the transaction which would cause failure of the transaction across all client applications ( 110 ). Thus, by implementing the grouping mechanism at the server middleware application ( 135 ) on the server computer ( 130 ), there is no danger of rollback due to client application involvement, which allows for a higher likelihood of each of the client applications being able to successfully commit. 
         [0041]    Further, although transaction isolation is somewhat sacrificed, client computers may selected for a group that produce the same or similar messages to provide a higher likelihood of each of the client applications being able to successfully commit. Further, the client middleware application ( 120 ) or the server middleware application ( 135 ) may be able to carry out some pre-checking before commencement of the transaction in order to provide a higher likelihood of each of the client applications being able to successfully commit (e.g., by checking up front that each client application has an appropriate authorisation level required in order to participate in a transaction). 
         [0042]    Although the group may be created arbitrarily, preferably the number of client computers is selected (e.g., using historical statistics) such that the number of client computers in a group is not too few (as this may cause inefficiency in that disk writes are forced for a small amount of work). 
         [0043]    It may further be advantageous to create more than one group so that multi-processors may be exploited and so that processing activity does not decrease significantly or come to a halt while a disk write takes place. 
         [0044]    If new client computers ( 105 ) connect to the server computer ( 130 ), the associated client applications ( 110 ) may be added to one or more groups (e.g., existing groups or newly created groups). Groups may also be re-balanced by moving client applications ( 110 ) from one group to another. 
         [0045]    In scenarios where a few, heavyweight client devices connect to a server device, a single thread per client computer waits for work from the client application and a disk force is undertaken (per client computer)—in this scenario, the client computer is typically busy due to the relatively large amount of processing capacity and system resources it has. The present subject matter, on the other hand, is particularly suited to a scenario where several lightweight client devices, which are less busy (and have a relatively small amount of processing capacity), connect to a server device. Although each lightweight client device is relatively less busy, due to the grouping of several lightweight client devices, there is typically enough work to process without much wait time. The present subject matter is particularly suited to scenarios where there is a need for scalability and efficiency (e.g., where there is a large number of client devices but where the data produced by each client device is small and infrequent). Efficiency gains may be obtained therefore, by grouping such client devices resulting in the total work produced being of a significant amount. Examples of such scenarios are online multi-user interactive (e.g., gaming/gambling) systems and utility monitoring systems. 
         [0046]    Memory may be allocated efficiently wherein a pool of buffers is made available for each group, and memory is allocated only to client applications ( 110 ) that have done some work. 
         [0047]    It should be noted that, while the preceding description of the present subject matter describes certain actions as being performed by a server computer, these actions may alternatively be performed by a client computer. 
         [0048]    The present subject matter allows for the aggregation of the disk forces and allows the use of a small number of threads when processing work from client applications. The transaction may use single phase or a two phase protocol. Preferably, in the case where the server computer receives a message from only one client computer in the subset (e.g., in accordance with a pre-configurable time threshold), processing is not held up waiting for a second message. Instead, default processing is reverted to (e.g., wherein the message from the one client computer is processed under a transaction that is associated only with the one client computer). 
         [0049]    As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or computer program product. Accordingly, aspects of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, micro-code, etc.) or an embodiment combining software and hardware aspects that may all generally be referred to herein as a “circuit,” “module” or “system.” Furthermore, aspects of the present invention may take the form of a computer program product embodied in one or more computer readable medium(s) having computer readable program code embodied thereon. 
         [0050]    Any combination of one or more computer readable medium(s) may be utilized. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. 
         [0051]    A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. 
         [0052]    Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing. 
         [0053]    Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java®, Smalltalk, C++ or the like and conventional procedural programming languages, such as the “C” programming language or similar programming languages. The program code may execute entirely on the user&#39;s computer, partly on the user&#39;s computer, as a stand-alone software package, partly on the user&#39;s computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user&#39;s computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider). 
         [0054]    Aspects of the present invention have been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. 
         [0055]    These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks. 
         [0056]    The computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. 
         [0057]    The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. 
         [0058]    A data processing system suitable for storing and/or executing program code will include at least one processor coupled directly or indirectly to memory elements through a system bus. The memory elements can include local memory employed during actual execution of the program code, bulk storage, and cache memories which provide temporary storage of at least some program code in order to reduce the number of times code must be retrieved from bulk storage during execution. 
         [0059]    Input/output or I/O devices (including but not limited to keyboards, displays, pointing devices, etc.) can be coupled to the system either directly or through intervening I/O controllers. 
         [0060]    Network adapters may also be coupled to the system to enable the data processing system to become coupled to other data processing systems or remote printers or storage devices through intervening private or public networks. Modems, cable modems and Ethernet cards are just a few of the currently available types of network adapters. 
         [0061]    The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the singular forms “a,” “an” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms “comprises” and/or “comprising,” when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. 
         [0062]    The corresponding structures, materials, acts, and equivalents of all means or step plus function elements in the claims below are intended to include any structure, material, or act for performing the function in combination with other claimed elements as specifically claimed. The description of the present invention has been presented for purposes of illustration and description, but is not intended to be exhaustive or limited to the invention in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the invention. The embodiment was chosen and described in order to best explain the principles of the invention and the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated.