MESSAGE RETRY OPTIMIZATION USING SELF-LEARNING

A system, method, and computer program product that are configured to: learn dependency relationships between types of messages in a distributed computing system that utilizes message-oriented middleware; generate a dependency graph associated with a first type of message, wherein the dependency graph includes respective ones of the dependency relationships associated with the first type of message; and delay an automated retry of processing a message of the first type of message until all the dependency relationships included in the dependency graph are satisfied.

BACKGROUND

Aspects of the present invention relate generally to message handling in computer-based messaging systems.

Message-oriented middleware (MoM) is software or hardware infrastructure supporting sending and receiving messages between distributed systems. MoM allows application modules to be distributed over heterogeneous platforms and reduces the complexity of developing applications that span multiple operating systems and network protocols. The middleware creates a distributed communications layer that insulates the application developer from the details of the various operating systems and network interfaces.

SUMMARY

In a first aspect of the invention, there is a computer-implemented method including: learning dependency relationships between types of messages in a distributed computing system that utilizes message-oriented middleware; generating a dependency graph associated with a first type of message, wherein the dependency graph includes respective ones of the dependency relationships associated with the first type of message; and delaying an automated retry of processing a message of the first type of message until all the dependency relationships included in the dependency graph are satisfied

In another aspect of the invention, there is a computer program product including one or more computer readable storage media having program instructions collectively stored on the one or more computer readable storage media. The program instructions are executable to: learn dependency relationships between types of messages in a distributed computing system that utilizes message-oriented middleware; generate a dependency graph associated with a first type of message, wherein the dependency graph includes respective ones of the dependency relationships associated with the first type of message; and delay an automated retry of processing a message of the first type of message until all the dependency relationships included in the dependency graph are satisfied.

In another aspect of the invention, there is a system including a processor set, one or more computer readable storage media, and program instructions collectively stored on the one or more computer readable storage media. The program instructions are executable to: learn dependency relationships between types of messages in a distributed computing system that utilizes message-oriented middleware; generate a dependency graph associated with a first type of message, wherein the dependency graph includes respective ones of the dependency relationships associated with the first type of message; and delay an automated retry of processing a message of the first type of message until all the dependency relationships included in the dependency graph are satisfied.

DETAILED DESCRIPTION

Aspects of the present invention relate generally to message handling in computer-based messaging systems and, more specifically, to message retry optimization using self-learning. Embodiments learn dependency relationships between messages in a middleware-oriented messaging (MoM) environment and delay a retry of processing a message until all dependency relationships of the message are satisfied. In this manner, embodiments reduce the number of retry attempts for processing messages in the environment.

When a message is delivered to an application in a MoM environment, the message may have an application-level dependency on another message arriving. If the other message does not arrive prior to first message, then the application attempting to process the first message generates an error. Messages that cause an error in this manner are queued in an error queue in the MoM system and automatically retried based on a predefined time interval. For example, the MoM system may hold the message in the error queue and provide the message back to the application once every minute (or other predefined time period) so that the application may retry processing the message automatically, i.e., without human interaction or input. This time-based retry process repeats until the application successfully processes the message, which occurs in this example only after the other message arrives. Such time-based retry techniques do not take into account the dependency of the first message on the other message, and blindly repeat the retry processing at every time interval regardless of whether the other message has arrived. Accordingly, in situations where a dependency between messages is not satisfied, time-based retry techniques waste system resources by performing retry processing when there is no chance of the retry processing succeeding due to the dependency not being satisfied.

Implementations of the invention address this problem by learning dependency relationships between messages and delaying an automated retry of processing a failed message until all the dependency relationships of the failed message are satisfied. For example, embodiments may provide a computer-implemented method comprising: learning dependency relationships between types of messages in a distributed computing system that utilizes message-oriented middleware; generating a dependency graph associated with a first type of message, wherein the dependency graph includes respective ones of the dependency relationships associated with the first type of message; and delaying an automated retry of processing a message of the first type of message until all the dependency relationships included in the dependency graph are satisfied. The method reduces the expenditure of system resources by reducing the number of retry attempts when processing messages in the environment. This reduction in the expenditure of system resources constitutes an improvement in the technology of computer-based messaging systems such as middleware-oriented messaging.

In one embodiment, there is a computer-implemented method for optimizing failed message retry attempts in a Message Oriented Middleware (MoM) based distributed computing system, the method comprising: analyzing information included in message event streams and message error logs to learn dependency relationships for processing messages, wherein a dependency relationship is a relationship in which processing of a message by a computing node is dependent upon receipt of one or more additional messages by the computing node; generating a dependency graph based on the learned dependency relationships for processing messages between various computing nodes in a distributed computing system; and delaying processing of a first type of message by the computing node until all dependency relationships associated with the first type of message, as indicated by the dependency graph, are satisfied. The method reduces the expenditure of system resources by reducing the number of retry attempts when processing messages in the environment, thus providing an improvement in the technology of computer-based messaging systems such as middleware-oriented messaging. The method may further comprise learning a dependency relationship for processing the first type of message based, at least in part, on: identifying an unsuccessful attempt by the computing node to process the first type of message; identifying that a retry attempt by the computing node to process the first type of message is successful; determining whether a second type of message arrived at the computing node prior to or after the successful retry attempt to process the first type of message; and responsive to determining that the second type of message arrived at the computing node prior to the successful retry attempt to process the first type of message, creating a dependency between the first type of message and the second type of message. The dependency graph may be a directed graph, in which nodes on the directed graph are representative of messages in an event stream, and edges connecting the nodes are representative of dependencies between the messages.

Implementations of the invention are necessarily rooted in computer technology. For example, the step of delaying an automated retry of processing a message of the first type of message until all the dependency relationships included in the dependency graph are satisfied is performed in a computing system and cannot be performed in the human mind. Moreover, learning dependency relationships by generating an artificial intelligence model based on message arrival logs and message error logs in the distributed computing system is computer based and cannot be performed in the human mind. Training and using an artificial intelligence model are, by definition, performed by a computer and cannot practically be performed in the human mind (or with pen and paper) due to the complexity and massive amounts of calculations involved. For example, an artificial neural network may have millions or even billions of weights that represent connections between nodes in different layers of the model. Values of these weights are adjusted, e.g., via backpropagation or stochastic gradient descent, when training the model and are utilized in calculations when using the trained model to generate an output in real time (or near real time). Given this scale and complexity, it is simply not possible for the human mind, or for a person using pen and paper, to perform the number of calculations involved in training and/or using an artificial intelligence model.

FIG. 2 shows a block diagram of an exemplary environment 205 in accordance with aspects of the invention. In embodiments, the environment 205 includes a messaging system 210, applications 215a, 215b, . . . 215n, and user devices 220a, 220b, . . . , 220m. The messaging system 210 may comprise a MoM system including a messaging bus 225 that delivers messages to and from the applications 215a-n. The applications 215a-n may comprise any plural number “n” of applications in a distributed computing system 217 and running on any number of servers, virtual machines, or containers, such as remote server 104 of FIG. 1. The user devices 220a-m may comprise any number “m” of user devices such as end user device 103 of FIG. 1. Network 230, which may comprise WAN 102 of FIG. 1, may provide communication between the elements of the environment 205.

In an embodiment, the environment 205 also includes a retry optimization server 235 that runs the retry optimization code of block 200 of FIG. 1. The retry optimization server 235 may comprise one or more instances of the computer 101 of FIG. 1, or may comprise one or more virtual machines or containers running on one or more instances of the computer 101 of FIG. 1. In embodiments, the retry optimization server 235 of FIG. 2 comprises a learning module 240 and a handling module 245, each of which may comprise modules of the retry optimization code of block 200. Such modules may include routines, programs, objects, components, logic, data structures, and so on that perform particular tasks or implement particular data types that the retry optimization code of block 200 uses to carry out the functions and/or methodologies of embodiments of the invention as described herein. These modules of the retry optimization code of block 200 are executable by the processing circuitry 120 of FIG. 1 to perform the inventive methods as described herein. The retry optimization server 235 may include additional or fewer modules than those shown in FIG. 2. In embodiments, separate modules may be integrated into a single module. Additionally, or alternatively, a single module may be implemented as multiple modules. Moreover, the quantity of devices and/or networks in the environment is not limited to what is shown in FIG. 2. In practice, the environment may include additional devices and/or networks; fewer devices and/or networks; different devices and/or networks; or differently arranged devices and/or networks than illustrated in FIG. 2.

In accordance with aspects of the invention, the learning module 240 is configured to learn dependency relationships between types of messages processed by the applications 215a-n in the distributed computing system 217, which utilizes message-oriented middleware of the messaging system 210. In embodiments, the applications 215a-n process messages received via the messaging system 210. When a first message is delivered to one of the applications 215a-n via the messaging system 210, the first message may have an application-level dependency on a second message arriving in the distributed system 217. If the second message does not arrive prior to first message, then the application attempting to process the first message generates an error. In this manner, the first message has a dependency relationship with the second message because processing the first message is dependent upon receipt of the second message in the distributed computing system 217. In embodiments, the learning module 240 analyzes data associated with the messages to learn such dependency relationships between types of messages processed by the applications 215a-n. In one example, the learning comprises generating an artificial intelligence model based on message arrival logs and message error logs in the distributed computing system 217. In another example, the learning comprises: identifying an unsuccessful attempt to process a first historic message of the first type of message by one of the applications 215a-n in the distributed computing system; identifying a successful retry attempt to process the first historic message by the one of the applications 215a-n in the distributed computing system; and in response to determining a second historic message of a second type of message arrived in the distributed computing system after the unsuccessful attempt and prior to the successful retry attempt, creating a dependency relationship between the first type of message and the second type of message.

In accordance with aspects of the invention, the learning module 240 is further configured to generate a dependency graph associated with a first type of message, wherein the dependency graph includes respective ones of the dependency relationships associated with the first type of message. In embodiments, the dependency relationships included in the dependency graph comprise relationships in which processing the message of the first type of message is dependent upon receipt of one or more additional messages in the distributed computing system. In embodiments, the dependency graph comprises a directed graph in which nodes on the directed graph are representative of messages in an event stream and edges connecting the nodes are representative of dependencies between the messages.

In accordance with aspects of the invention, the handling module 245 is configured to delay a retry of processing a message of the first type of message until all the dependency relationships included in the dependency graph are satisfied. In embodiments, in response to one of the applications 215a-n generating an error when processing a message, the handling module 245 puts the message in a queue, obtains the dependency graph for this type of message, and monitors other messages in the distributed computing system 217 to determine whether all the dependencies included in the dependency graph for this type of message are satisfied. This may comprise, for example, identifying one or more types of messages associated with one or more dependency relationships included in the dependency graph, and determining whether messages of these identified one or more types have been received in the distributed computing system 217 prior to the message that caused the error. In the event that all the dependency relationships included in the dependency graph are not satisfied, then the handling module 245 holds the message in the queue and continues to monitor other messages in the distributed computing system 217. When the handling module 245 determines that all the dependency relationships included in the dependency graph are satisfied, then the handling module 245 releases the message from the queue for a retry attempt by the one of the applications 215a-n that previously generated the error for this message. In this manner, the retry processing is optimized based on dependency relationships for the particular message rather than being repeated at a predefined time interval.

FIG. 3 shows a block diagram of an exemplary environment 305 that illustrates aspects of an exemplary use case in accordance with aspects of the invention. The environment 305 includes the messaging system 210, user devices 220a-m, and retry optimization server 235 as in FIG. 2. Inventory management system (IMS) 315a, customer relationship management (CRM) system 315b, and purchasing system 315c in FIG. 3 correspond to instances of applications 215a-n of FIG. 2. The IMS 315a, CRM system 315b, and purchasing system 315c may be used by an enterprise to provide inventory and purchasing management for the enterprise.

In the example shown in FIG. 3, when a new item is to be added to the inventory system of the enterprise, one of the user devices 320a-m sends an item message to the IMS 315a via the messaging bus 325 of the MoM system. The item message defines a new item to be added to the inventory system and is processed by the IMS 315a to update the inventory system to include this new item. During normal operation, after the item is added to the inventory system, one of the user devices 320a-m sends an inventory message to the CRM system 315b to populate a quantity of this item in inventory. During normal operation, after the item is added to the inventory system and after the quantity of the item in inventory is populated, one of the user devices 320a-m sends a purchase order message to the purchasing system 315c, where the purchase order message indicates a purchase of one or more of the quantity of the item in inventory. In this example, processing of the purchase order message by the purchasing system 315c depends on the item message and the inventory message having already been received and processed by the IMS 315a and the CRM system 315b, respectively. However, the respective messages do not always arrive in the this order. As a result, if the purchasing system 315c receives and attempts to process the purchase order message before the arrival and processing of the item message and/or the inventory message, then the purchasing system 315c generates an error for the purchase order message.

With continued reference to the exemplary use case of FIG. 3, the learning module 240 is configured to learn the dependency relationships between the purchase order message, the item message, and the inventory message, and to convert the learned dependency relationships into a dependency graph 350. As shown in FIG. 3, the dependency graph 350 may comprise a directed graph in which nodes on the directed graph are representative of messages in an event stream (i.e., the purchase order message, the item message, and the inventory message in this example), and in which edges connecting the nodes are representative of dependencies between the messages. In embodiments, the learning module 240 learns the dependency relationships by analyzing message arrival logs 355 and message error logs 360 of the messaging system 210. The message arrival logs 355 contain information that identifies messages that arrive in the messaging system 210 and what time those message arrived at one of the applications such as IMS 315a, CRM 315b, and purchasing system 315c. The message error logs 360 contain information that identifies a message that caused an error, which application generated the error for the message, and what time the application generated the error for the message.

With further reference to the exemplary use case of FIG. 3, in response to the purchasing system 315c generating an error for the purchase order message, the handling module 245 is configured to delay retry processing of the purchase order message by the purchasing system 315c until all the dependency relationships in the dependency graph 350 have been satisfied. In this example, the handling module 245 performs this by receiving the purchase order message from the purchasing system 315c, holding the purchase order message in a queue until such time as the item message and the inventory message have been received and processed, and then releasing the purchase order message back to the purchasing system 315c for the purchasing system 315c to retry processing of the purchase order message.

In some embodiments, the learning the dependency relationships comprises generating an artificial intelligence (AI) model based on message arrival logs and message error logs in the distributed computing system. As described previously, the message arrival logs contain information that identifies all historic (i.e., past) messages that arrived in the messaging system, a type of each message, and what time each message arrived at one of the applications. As described previously, the message error logs contain information that identifies a message that caused an error, which application generated the error when processing the message, what time the application generated the error for the message, and whether the error was generated during the initial processing or retry processing of the message.

In embodiments, the learning module 240 uses the information from the message arrival logs and message error logs to populate a database for different message types, wherein the database includes information that indicates success or failure of processing retries of a first type of message and whether a not a second type of message arrived between a failed retry and a successful retry of the first type of message. In embodiments, the learning module 240 uses the database to generate a training dataset for respective types of message, wherein the training dataset comprises: a first binary value (e.g., an X value) that indicates whether a message of a second type arrived before a retry of a message of a first type (e.g., 1 if true, 0 if false); and a second binary value (e.g., a Y value) that indicates whether the retry of the message of the first type succeeded on the next attempt (e.g., 1 if true, 0 if false). In embodiments, the training dataset includes an (X, Y) value pair for all messages of the first message type and the second message type, and the learning module 240 uses an AI learning algorithm with the training dataset to learn an AI model that predicts a value of Y for a given value of X for message of the types. The AI model may comprise, for example and without limitation, a decision tree, a support vector machine, or a neural network. In accordance with aspects of the invention, the properties of the AI model (e.g. weights on a decision tree, or attention weights on a neural network/transformer) indicate whether successful retry depends on the arrival of a message of a particular type. In implementations, the messages with higher weights for predicting the Y value are included in the dependency graph. In some embodiments, weights are added to the edges of the dependency graph.

In further embodiments, the learning module 240 is configured to update the AI model based on the success or failure of a retry attempt to process a message. For example, in response to a retry attempt of processing a message of a first type, the learning module 240 may update the dataset for this type of message with a new (X, Y) value pair based on this retry attempt, and the learning module may re-learn the AI model using the updated dataset. In this manner, the learning module 240 may be configured to update the AI model based on a successful retry attempt to process a message of a first type of message or an unsuccessful retry attempt to process the message of the first type of message.

In some embodiments, the learning the dependency relationships comprises the learning module 240 analyzing the message arrival logs and message error logs to: identify an unsuccessful attempt to process a first historic message of a first type of message by one of the applications in the distributed computing system; identify a successful retry attempt to process the first historic message by the one of the applications in the distributed computing system; and in response to determining a second historic message of a second type of message arrived in the distributed computing system after the unsuccessful attempt and prior to the successful retry attempt, create a dependency relationship between the first type of message and the second type of message. In this manner, by analyzing when a second type of message arrived relative to the unsuccessful and successful retry attempts of a first type of message, the learning module 240 may determine whether the first type of message has a dependency on the second type of message. For example, if a retry attempt of a first type of message fails before a second type of message arrives, and if a retry attempt of the first type of message succeeds after the second type of message arrives, then the learning module 240 may infer that the first message has a dependency relationship on the second type of message. Conversely, if a retry attempt of a first type of message fails before a second type of message arrives, and if a retry attempt of the first type of message fails after the second type of message arrives, then the learning module 240 may infer that the first message does not have a dependency relationship on the second type of message. By analyzing thousands of such instances from historic messages in the messaging system (e.g., via the message arrival logs and message error logs), the learning module 240 may learn with confidence which types of messages have a dependency relationship with respective other types of messages.

In embodiments, the learning module 240 may generate different respective dependency graphs for different respective types of messages. In this manner, when an application generates an error in processing a message, the handling module 245 obtains the dependency graph associated with the type of message that caused the error.

FIG. 4 shows a block diagram of an exemplary environment 405 in accordance with aspects of the invention. The environment 405 includes the messaging system 210, applications 215a-n, and user devices 220a-m as in FIG. 2. In the embodiment shown in FIG. 4, the retry optimization code of block 200 is executed by the messaging system 210 rather than by a separate retry optimization server 235 as in FIG. 2. Although not shown, the retry optimization code of block 200 in FIG. 4 may include the learning module 240 and the handling module 245 that operate in a similar manner as described with respect to FIG. 2.

FIG. 5 shows a block diagram of an exemplary environment 505 in accordance with aspects of the invention. The environment 505 includes the messaging system 210, applications 215a-n, and user devices 220a-m as in FIG. 2. In the embodiment shown in FIG. 5, the retry optimization code of block 200 is executed by one of the applications 215a-n in the distributed computing system rather than by a separate retry optimization server 235 as in FIG. 2. Although not shown, the retry optimization code of block 200 in FIG. 5 may include the learning module 240 and the handling module 245 that operate in a similar manner as described with respect to FIG. 2.

FIG. 6 shows a flowchart of an exemplary method in accordance with aspects of the present invention. Steps of the method may be carried out in the environment of FIG. 2 and are described with reference to elements depicted in FIG. 2. Steps of the method may alternatively be carried out in the environments of FIGS. 4 and 5, respectively.

At step 605, the system learns dependency relationships between types of messages in a distributed computing system that utilizes message-oriented middleware. In embodiments, and as described with respect to FIGS. 2-3, the learning module 240 learns the dependency relationships by analyzing message arrival logs and message error logs.

At step 610, the system generates a dependency graph associated with a first type of message, wherein the dependency graph includes respective ones of the dependency relationships associated with the first type of message. In embodiments, and as described with respect to FIGS. 2-3, the learning module 240 generates a dependency graph such as dependency graph 350.

At step 610, the system delays a retry of processing a message of the first type of message until all the dependency relationships included in the dependency graph are satisfied. In embodiments, and as described with respect to FIGS. 2-3, the handling module 245 delays the retry of processing a message by holding the message in a queue until all the dependency relationships included in the dependency graph are satisfied.

In still additional embodiments, implementations provide a computer-implemented method, via a network. In this case, a computer infrastructure, such as computer 101 of FIG. 1, can be provided and one or more systems for performing the processes in accordance with aspects of the invention can be obtained (e.g., created, purchased, used, modified, etc.) and deployed to the computer infrastructure. To this extent, the deployment of a system can comprise one or more of: (1) installing program code on a computing device, such as computer 101 of FIG. 1, from a computer readable medium; (2) adding one or more computing devices to the computer infrastructure; and (3) incorporating and/or modifying one or more existing systems of the computer infrastructure to enable the computer infrastructure to perform the processes in accordance with aspects of the invention.