Message flow processing
By assigning timestamps to messages and sorting them by timestamps in multiple queues, the problem of data disorder caused by scaling in the existing technology is solved, parallel processing and data alignment of time message flows are realized, and the accuracy and accuracy of processing are improved. reliability.
Patent Information
- Application Number
- CN202080056334.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-08-20
- Filing Date
- 2020-08-18
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2040-08-18
AI Technical Summary
When existing data processing systems process time data, the output data is out of order due to scaling, and cannot accurately process time-related data, making data diagnosis and problem solving difficult.
By assigning a timestamp to each message and sorting by timestamp in multiple queues, the timestamp difference is used to control message retrieval, ensuring synchronous retrieval of messages in multiple queues and avoiding data disorder.
It realizes parallel processing of time message streams under the scaling processing engine, maintains approximate time alignment of data, reduces the risk of low data transmission efficiency, and improves the accuracy and reliability of data processing.
Smart Images

Figure CN114245982B_ABST
Abstract
Description
Background Art
[0001] The present disclosure relates generally to processing data, and more particularly to a method for processing a stream of event messages.
[0002] The present disclosure also relates to a system for processing a message stream.
[0003] The present disclosure further relates to a computer program product comprising a computer readable program code enabling a processor of a system to implement such a method.
[0004] Conventional data processing systems for processing temporal data (or data that does not require strict ordering but needs to be processed at similar times) may typically include a processing engine adapted to process data streams. Such a processing engine may process fast data streams in real time, and in order to cater to streams of different sizes, the processing engine may be scaled based on the size of the data stream. However, such scaling may cause the output data to be out of order and thus render the resulting output data unusable.
[0005] For example, an application in the system may send metric data (e.g., response time, transaction rates, and central processing unit (CPU) usage) to a metric processing engine via a message center. The metric processing engine may then send the metric data to an open source metric analysis tool. Scaling the metric processing engine includes dividing topics corresponding to the metric data into partitions (or queues) so that the metric data can be shared between instances of the metric processing engine. However, if a problem occurs in one of the instances of the metric processing engine, the instances may become out of sync, resulting in unusable output at a user interface of a metric analysis tool (e.g., transaction rate data may show a workload spike out of sync with other data, preventing accurate data correlation and problem diagnosis).
[0006] In another example, a company that sells or distributes a large number of items (e.g., a ticket company) can handle a high rate of orders by unwinding the actions corresponding to ordering items and processing orders. Sorting items can result in messages being placed on item-specific topics, where the sorted messages (i.e., messages corresponding to the order created) are arranged across multiple partitions (hereinafter referred to as queues) corresponding to the topic. Multiple processing engines can be used to process messages in each queue. However, there is a risk that the processing of messages may be unevenly distributed across multiple processing engines. Therefore, this increases the risk of data arriving out of order, for example, individuals receive the last item in a large number of items, even if their corresponding orders are created significantly later than other orders from items that have not yet been received. Further, the risk of individuals not having their orders fulfilled can increase due to "slow" processing engines.
[0007] Therefore, there is a need in the art to solve the above problems. Summary of the invention
[0008] The present disclosure also seeks to provide a system for processing a message stream.
[0009] The present disclosure seeks to provide a computer-implemented method for processing a message stream.
[0010] The present disclosure further seeks to provide a computer program product comprising a computer program code for implementing the proposed method when the computer program code is executed by a controller unit.
[0011] According to one aspect of the present disclosure, a computer-implemented method for processing a message stream is provided. The method includes obtaining messages of the message stream, each message having an associated timestamp. The method further includes storing each message in at least one of a plurality of queues, wherein the messages of each queue are sorted based on their timestamps so that the message with the earliest timestamp is at the front of the queue. The method also includes controlling retrieval of a target message from the front of a target queue based on a time difference between the timestamp of the target message and the timestamp of the front message of each queue in the other queues of the plurality of queues.
[0012] According to another aspect of the present disclosure, a computer program product for processing a message stream is provided, which includes a computer-readable storage medium having program instructions embodied therein, which can be executed by a processing unit to cause the processing unit to perform a method according to the proposed embodiment.
[0013] According to another aspect of the present disclosure, a processing system is provided, which comprises at least one processor and a computer program product according to an embodiment. The at least one processor is adapted to execute computer program code of the computer program product.
[0014] According to another aspect of the present disclosure, a system processing of a message stream is provided. The system includes an interface configured to obtain messages of the message stream, each message having an associated timestamp. The system further includes a queue component configured to store each message in at least one of a plurality of queues. The messages of each queue are sorted based on their timestamps so that the message with the earliest timestamp is at the front of the queue. The system also includes a message retrieval component configured to control the retrieval of a target message from the front of a target queue in a plurality of queues based on the time difference between the timestamp of the target message and the timestamp of the front message of each queue in the other queues in the plurality of queues.
[0015] BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Preferred embodiments of the present invention will now be described, by way of example only, with reference to the following drawings, in which:
[0017] Figure 1 shows a graphical representation of an exemplary distributed system in which aspects of the illustrative embodiments may be implemented;
[0018] Figure 2 is a block diagram of an example system in which aspects of the illustrative embodiments may be implemented;
[0019] Figure 3 is a simplified block diagram of an example embodiment of a system for parallel processing of time message streams;
[0020] Figure 4 is a flow chart of a computer-implemented method for parallel processing of temporal message streams;
[0021] Figure 5 is a diagram of steps involved in the method of an exemplary embodiment, wherein the vertical axis depicts each of a plurality of queues and the horizontal axis depicts the time of timestamps corresponding to messages; and
[0022] Figure 6 is a simplified block diagram of an exemplary embodiment of a system for parallel processing of event message streams. DETAILED DESCRIPTION
[0023] The accompanying drawings are merely schematic and are not drawn to scale. It should also be understood that the same reference numerals are used throughout the drawings to indicate the same or similar parts.
[0024] In the context of the present application, when the embodiments of the present disclosure constitute a method, such a method may be a process for being executed by a computer, i.e., a computer-implementable method. Therefore, the various steps of the method may reflect various parts of a computer program, for example, various parts of one or more algorithms.
[0025] Moreover, in the context of the present application, a system may be a single device or a collection of distributed devices suitable for performing one or more embodiments of the method of the present disclosure. For example, a system may be a personal computer (PC), a server, or a collection of PCs and / or servers connected via a network such as a local area network, the Internet, etc., to collaboratively perform at least one embodiment of the method of the present disclosure.
[0026] Concepts for processing message streams are proposed. Such concepts can enable the simultaneous processing of temporal data by scaling processing engines while maintaining approximate time alignment of the processing. Thus, various embodiments can facilitate concurrent processing of temporal message streams.
[0027] Embodiments may be implemented in conjunction with a messaging or event system, e.g. Message Queuing (MQ) or Java Messaging Service (JMS) implementation.
[0028] The proposed embodiments may employ the concept of defining a set of queues (or partitions or streams) where messages may be stored and time aligned (e.g., queued). Messages may be retrieved from the queues in order, but such retrieval may be controlled based on timestamps associated with the messages. For example, timestamps may be analyzed and used to ensure that messages retrieved from the queues remain relatively synchronized.
[0029] Embodiments of the present invention provide a message retrieval component. Such a message retrieval component can be configured to control the retrieval of messages from the front of a queue in a plurality of queues based on the time difference between the timestamp of the message and the timestamp of the front message in each of the other queues in the plurality of queues. For example, by only allowing the retrieval of messages if the message is within a predetermined allowable time difference of the earliest timestamp among all queues, the retrieved messages can be kept time-aligned.
[0030] Embodiments may therefore provide improvements in parallel processing of temporal message streams by maintaining approximate time alignment of the data processed in parallel.
[0031] As an example, embodiments may be implemented in conjunction with messaging or streaming services. Such embodiments may achieve time alignment of message streams without enforcing strict ordering and / or single-threaded behavior that does not allow scaling of processing engines. Thus, the distribution of messages is optimized, reducing the risk of inefficiencies in messaging or streaming services. This is an example of an advantage over the prior art.
[0032] For purposes of this disclosure, a target message is one of the messages of a message stream. When a customer (or other component) attempts to remove a target message from a queue (e.g., the subject of a GET command, where the GET command is a code that removes a message from a queue for subsequent processing), the message becomes a target message. Typically, the target message will be the first message in the queue (e.g., the next line, the message with the earliest timestamp, etc.). A queue containing a target message may be referred to as a target queue.
[0033] For the purposes of this disclosure, topics can be groups, streams, and / or partitions. Topics can be any way to categorize and / or organize multiple messages in a message stream to categorize them into different queues. These topics can be (or are related to) the size of the message, the type of message (e.g., format), the data source, random, polling, order, and / or any other method of classification. For example, assume that the system is related to ticket sales for an event. At a specific time, tickets will be published and several purchase messages will be created. The topics of tickets can be: the number of tickets purchased, the total amount purchased, based on individual ticket prices, based on the location of the originating purchase, based on the interval of the requested ticket (e.g., seats vs open seats), and / or other similar factors.
[0034] In the proposed embodiment, controlling the retrieval may include determining the time difference between the target message and the preceding message from each other queue. The time difference is the difference between the timestamps of the two messages. Controlling the retrieval may then include identifying the maximum value of the time difference from the determined time differences, and then allowing the target message to be retrieved from the target queue based on whether the maximum value of the time difference exceeds a threshold. In this way, the retrieval of messages may be controlled so that messages are retrieved uniformly from the queue across all queues. This may optimize the time alignment of the data corresponding to the messages, thereby enabling data that is similar in time to be processed at similar times. Thereby, the risk of disrupting the order of the sequence of time data due to scaling may be reduced. This provides the advantage of an efficient scaling process.
[0035] In some embodiments, controlling the retrieval may further include receiving an input signal representing a time alignment requirement and determining the threshold based on the received input signal. Therefore, the threshold for establishing the retrieval of the message may depend on the time alignment requirement. This can establish the retrieval of the message based on the requirements for the method and / or system, and can be automatically adjusted relative to the requirements. In this way, the efficiency of the method and / or system for parallel processing of time message streams is optimized.
[0036] In the proposed embodiment, granting retrieval of the target message may occur when the maximum value of the time difference does not exceed a threshold value. Further, if the maximum value of the time difference exceeds the threshold value, retrieval of the target message may be denied. Thus, retrieval of messages may be maintained evenly across each of the plurality of queues. This may reduce the risk of biasing between the plurality of queues when retrieving messages, thereby reducing the risk of a queue retrieving a significantly higher / lower number of messages than the average number between the plurality of queues.
[0037] In some embodiments, if retrieval of a target message from a target queue is denied, an error message may be generated. In this way, a user may be alerted to the denial of retrieval of a message. This may enable identification of the queue corresponding to the denied retrieval, thereby enabling determination and analysis of the retrieval rate for each of a plurality of queues. If a relatively large number of retrievals are denied in a particular queue whose number can be determined, the queue may therefore be identified and corrective action may be taken.
[0038] The method for parallel processing of a temporal message stream may further include generating a timestamp for each obtained message, the timestamp representing the time associated with the message. In this way, each message includes a corresponding time identified by the timestamp. For example, the timestamp associated with the message may identify the time when the message was obtained (e.g., received by the interface). This enables organizing the messages in a time-related sequence, optimizing time alignment.
[0039] An example of a timestamp may include the time a message was PUT to a queue, where PUT is a command in a programming language. This may be generated by the client or messaging system that published the message. This may be done when the message is placed on a queue or when the message data is created. The time may be a time period or a full date-time string in the message body (or in the message header / metadata).
[0040] In some embodiments, each message may be associated with at least one of a plurality of topics. In some embodiments, the method for parallel processing of a temporal message stream may further include: for each of the plurality of topics, defining one or more queues associated with each topic. The method may further include storing each message in at least one of a plurality of queues associated with at least one topic in a queue associated with the same topic. Therefore, the method may be extended to grouping more than one topic, and thus grouping corresponding multiple queues. This may enable processing of multiple topics related to a message in parallel, improve the efficiency of the method and / or system, and enable increasing the complexity of the method and / or system.
[0041] Figure 1 A graphical representation of an exemplary distributed system in which aspects of the illustrative embodiments may be implemented is depicted. Distributed system 100 may include a network of computers in which aspects of the illustrative embodiments may be implemented. Distributed system 100 contains at least one network 102, which is a medium for providing communication links between different devices and computers connected together within distributed data processing system 100. Network 102 may include connections such as wired, wireless communication links, or fiber optic cables.
[0042] In the depicted example, first server 104 and second server 106 are connected to network 102 along with storage unit 108. Additionally, clients 110, 112, and 114 are also connected to network 102. Clients 110, 112, and 114 may be, for example, personal computers, network computers, and the like. In the depicted example, first server 104 provides data, such as boot files, operating system images, and applications, to clients 110, 112, and 114. In the depicted example, clients 110, 112, and 114 are clients to first server 104. Distributed processing system 100 may include additional servers, clients, and other devices not shown.
[0043] In the depicted example, distributed system 100 is the Internet, where network 102 represents a global collection of networks and gateways that use the Transmission Control Protocol / Internet Protocol (TCP / IP) suite of protocols to communicate with each other. At its core, the Internet is a backbone of high-speed data communication lines between major nodes or host computers, consisting of thousands of commercial, government, educational, and other computer systems that route data and messages. Distributed system 100 may also be implemented to include multiple different types of networks, such as, for example, an intranet, a local area network (LAN), a wide area network (WAN), and the like. As described above, Figure 1 It is intended as an example, not as an architectural limitation to the various embodiments of the present disclosure, and therefore, Figure 1 The specific components shown in the disclosure should not be construed as limiting the environments in which illustrative embodiments of the disclosure may be implemented.
[0044] Figure 2 2 is a block diagram of an example system 200 in which aspects of the illustrative embodiments may be implemented. System 200 is a computer (such as Figure 1 In the example of a client 110 in FIG. 1 , computer usable code or instructions implementing the processes of the illustrative embodiments of the present disclosure may be located therein.
[0045] In the depicted example, system 200 employs a hub architecture including north bridge and memory controller hub (NB / MCH) 202 and south bridge and input / output (I / O) controller hub (SB / ICH) 204. Processing unit 206, main memory 208, and graphics processor 210 are connected to NB / MCH 202. Graphics processor 210 may be connected to NB / MCH 202 via an accelerated graphics port (AGP).
[0046] In the depicted example, a local area network (LAN) adapter 212 is connected to the SB / ICH 204. An audio adapter 216, a keyboard and mouse adapter 220, a modem 222, a read-only memory (ROM) 224, a hard disk drive (HDD) 226, a CD-ROM drive 230, a universal serial bus (USB) port and other communication ports 232, and a PCI / PCIe device 234 are connected to the SB / ICH 204 via a first bus 238 and a second bus 240. PCI / PCIe devices may include, for example, Ethernet adapters, plug-in cards, and PC cards for notebook computers. PCI uses a card bus controller, while PCIe does not. ROM 224 may be, for example, a flash basic input / output system (BIOS).
[0047] HDD 226 and CD-ROM drive 230 are connected to SB / ICH 204 via second bus 240. HDD 226 and CD-ROM drive 230 may use, for example, an integrated drive electronics (IDE) or serial advanced technology attachment (SATA) interface. Super I / O (SIO) device 236 may be connected to SB / ICH 204.
[0048] The operating system runs on the processing unit 206. The operating system coordinates and provides Figure 2 The control of various components within the system 200 in the system 200. As a client, the operating system can be a commercially available operating system. An object-oriented programming system, such as a Java™ programming system, can run in conjunction with the operating system and provide calls to the operating system from a Java™ program or application executing on the system 200.
[0049] As a server, system 200 may be, for example, a server running an advanced interactive execution Operating system or Operating System Computer System. System 200 may be a symmetric multiprocessor (SMP) system including multiple processors in processing unit 206. Alternatively, a single processor system may be employed.
[0050] Instructions for the operating system, programming system, and applications or programs are located on storage devices such as HDD 226 and may be loaded into main memory 208 for execution by processing unit 206. Similarly, one or more message handling programs according to embodiments may be suitable for storage by storage devices and / or main memory 208.
[0051] The processes of the illustrative embodiments of the present disclosure may be performed by processing unit 206 using computer usable program code, which may be located in a memory, such as main memory 208 , ROM 224 , or one or more peripheral devices 226 and 230 .
[0052] Bus systems (such as Figure 2 The first bus 238 or the second bus 240 shown may include one or more buses. The bus system may be implemented using any type of communication structure or architecture that provides data transfer between different components or devices attached to the structure or architecture. Communication units (such as Figure 2 The modem 222 or network adapter 212 may include one or more devices for sending and receiving data. The memory may be, for example, the main memory 208, ROM 224 or a memory such as a memory card. Figure 2 The cache found in NB / MCH202.
[0053] Those of ordinary skill in the art will recognize that Figure 1 and 2 The hardware in the embodiment may vary depending on the implementation and may be changed without affecting the scope of the claims. Figure 1 and 2 The hardware depicted in the example embodiment may use other internal hardware or peripheral devices, such as flash memory, equivalent non-volatile memory, or optical disk drives, etc. In addition, the processes of the example embodiments may be applied to multi-processor data processing systems other than the aforementioned systems without departing from the spirit and scope of the present disclosure.
[0054] Furthermore, system 200 may take the form of any of a number of different data processing systems, including a client computing device, a server computing device, a tablet computer, a laptop computer, a telephone or other communication device, a personal digital assistant (PDA), etc. In some illustrative examples, system 200 may be a portable computing device configured with flash memory to provide non-volatile memory for storing operating system files and / or user-generated data. Thus, system 200 may be essentially any known or later developed data processing system, without architectural limitation.
[0055] See now Figure 3 , depicting a simplified block diagram of an exemplary embodiment of a system for parallel processing of temporal message streams.
[0056] The system includes an interface 310 configured to obtain messages of a message stream, each message having an associated timestamp. The system further includes a queue component 320 configured to store each message in each of a plurality of queues 322, wherein the messages of each queue 322 are sorted based on their timestamps so that the message with the earliest timestamp is positioned at the front of the queue 322 (i.e., a first-in, first-out (FIFO) queue), message PB-1 in queue 322B. The system further includes a message retrieval component 330 configured to control the retrieval of a target message from the front of a target queue of the plurality of queues 322 based on a time difference between the timestamp of the message and the timestamp of the front message of each queue in the other queues 322 in the plurality of queues 322. The message retrieval component 330 can communicate with a plurality of consumers 332, wherein each consumer 332 can retrieve a message from a corresponding queue 322, message PA-1 in consumer 332A. Here, although a consumer 332 may have a 1:1 mapping to a queue, a consumer 332 may retrieve messages from more than one queue 322 , and a queue 322 may have messages retrieved by more than one consumer 332 .
[0057] In some embodiments, the message retrieval component 330 is further configured to determine, for each of the other queues 322, a time difference between the timestamp of the target message and the preceding message of each queue 322. The message retrieval component is further configured to identify a maximum value of the time differences from the determined time differences, and to allow or deny retrieval of the target message from the target queue 322 based on whether the maximum value of the time differences exceeds a threshold.
[0058] In one embodiment, the message retrieval component 330 is also configured to allow retrieval of the target message from the target queue if the maximum value of the time difference does not exceed the threshold, and to refuse retrieval of the target message from the target queue if the maximum value of the time difference exceeds the threshold. In some embodiments, the message with the earliest timestamp (or the message associated with the maximum difference) is retrieved, and the time difference is recalculated. Then there is a second largest difference, or a remaining maximum difference. These differences are determined in the same manner as the maximum difference.
[0059] In one embodiment, the message retrieval component 330 is further configured to generate an error message if retrieval of the target message from the queue 322 is denied.
[0060] In one embodiment, the system further includes an alignment configuration component (not shown) configured to receive an input signal representing a time alignment requirement and determine the threshold based on the received input signal. In various embodiments, the alignment configuration component is a component of and / or incorporated into the interface 310, the queue component 320, the message retrieval component 330, and / or a separate component.
[0061] In some embodiments, the system further includes a time component configured to generate a timestamp representing the time associated with the message for each message and associate the generated timestamp with the message. For example, the timestamp of the message can represent the time when the message was generated or PUT to the queue. In various embodiments, the time component is a component of and / or incorporated into: interface 310, queue component 320, message retrieval component 330, and / or a separate component.
[0062] In some embodiments, each message is associated with at least one of the plurality of topics. The queue component 320 is further configured to, for each of the plurality of topics, associate one or more of the queues 322 with the one or more topics and store each message in at least one of the plurality of queues 322 associated with the topic to which the message relates.
[0063] See now Figure 4 , depicts a computer-implemented method for processing a message stream according to one embodiment. Such a method can enable simultaneous processing of time message streams by scaling processing engines while maintaining approximate time alignment of the processing.
[0064] Step 410 includes obtaining a plurality of messages of a message stream, each message having an associated timestamp. In some implementations, step 410 includes generating a timestamp for each message.
[0065] In one embodiment, each message is associated with at least one topic in a plurality of topics. In some embodiments, the method further comprises: for each topic in the plurality of topics, associating at least one topic to each queue. In some embodiments, the method further comprises: partitioning the topic into a plurality of partitions and assigning one or more consumers to each queue.
[0066] For example, a user may create a topic in a messaging system that contains five queues (e.g., partitions, streams, and / or topics). Five consumers may be assigned to the topic as group consumers, with one consumer provided to each queue. Each message is distributed to one of the queues based on some classification factor (e.g., size, content, origin, data type, round-robin, random, etc.). Each consumer processes the message once it has retrieved the message from the queue corresponding to its respective queue. This example is shown in Figure 3 , in which five queues 322A, 322B, 322C, 322D, 322E and five assigned consumers 332A, 332B, 332C, 332D, 332E handle messages PA-1, PA-2, PA-3 for queue 322A, PB-1 for queue 322B, and PC-1 for queue 322C. Figure 5A diagram showing the steps involved in this example is shown, wherein the vertical axis describes each of a plurality of queues and the horizontal axis describes the time of timestamps corresponding to messages. The example described below involves Figure 3 and Figure 5 The information described in .
[0067] Step 420 includes storing each message in at least one of a plurality of queues, wherein the messages of each queue are ordered based on their timestamps so that the message with the earliest timestamp is at the front of the queue. Here, each message is stored in at least one of the queues associated with the topic to which the message relates.
[0068] Step 430 includes controlling retrieval of a target message from the front of the target queue based on a time difference between the timestamp of the message and the timestamp of the front message of each queue in the other queues of the plurality of queues. In the example, messages can be retrieved from the plurality of queues to consumers uniformly and continuously from each of the plurality of queues.
[0069] In one embodiment, controlling the retrieval may include, for each of the other queues, determining a time difference between a timestamp of the target message and a preceding message of each of the other queues. Then, controlling the retrieval may include identifying a maximum value of the time differences from the determined time differences, and then, based on whether the maximum value of the time differences exceeds a threshold, allowing the target message to be retrieved from the target queue.
[0070] In an example, a user may define a threshold of 100 ms, which may also be referred to as time alignment. However, the threshold may be greater or less than 100 ms. For example, the first queue 322A of the five queues may obtain a message containing a relatively large event (event PA-1) with a timestamp of 20:00:00.000 and a duration of 200 ms. The message corresponding to event PA-1 is retrieved by consumer 332A corresponding to the first queue. The next message in the first queue 322A may contain another event, event PA-2, with a timestamp of 20:00:00.100. Consumer 332B corresponding to the next consecutive queue (i.e., second queue 322B) may attempt to retrieve the next event from the front message of the second queue 322B, for example, event PB-1 with a timestamp of 20:00:00.190. The timestamp of each event corresponding to the message at the front of each queue may be determined.
[0071] In one embodiment, if the maximum value of the time difference does not exceed the threshold, the target message is allowed to be retrieved from the target queue, and if the maximum value of the time difference exceeds the threshold, the target message is denied to be retrieved from the target queue. In this way, when retrieving messages, the timestamps of the messages at the front of each queue are compared. If the value of the time difference between the earliest timestamp across all queues and the timestamp corresponding to the target message in the target queue is equal, the message corresponding to the earliest timestamp is retrieved.
[0072] In this example, the time difference between the timestamp corresponding to event PB-1 (20:00:00.190) and the timestamp corresponding to event PA-1 (20:00:00.100) is 90ms, which does not exceed the threshold of 100ms. This is obtained by subtracting the timestamp of the previous message from the timestamp of the target message (e.g., (target message timestamp)-(first message of different queue), 20:00:00.190-20:00:00.100). This allows the message containing event PB-1 to be retrieved by consumer 332B corresponding to the target queue (in this case, the second queue 322B).
[0073] In one embodiment, allowing retrieval of the target message further includes generating an error message if retrieval of the target message from the target queue is denied. The error message may include a return code or message indicating that the output data is not synchronized. If retrieval of the target message from the target queue is denied, the process may be temporarily suspended until the timestamps corresponding to the messages at the front of each queue allow a corresponding time difference that does not exceed a threshold.
[0074] Controlling the retrieval may further include receiving an input signal indicative of a time alignment requirement, and then determining the threshold based on the received input signal.
[0075] In this example, the message from the next consecutive queue (the third queue 322C) may contain another event, event PC-1 with a timestamp of 20:00:00.250. The timestamp of each event corresponding to the message to the front of each queue can be determined. The timestamp corresponding to event PA-2 is the earliest at this point in time, and the time difference between the timestamp corresponding to event PA-2 (20:00:00.100) and the timestamp corresponding to event PC-1 (20:00:00.250) is 150ms, which exceeds the threshold of 100ms. Thus, the request to retrieve from queue 322C is rejected, and event PC-1 is not retrieved. Consider instead that PA-2 is the target message, and now the difference is negative 150ms, which is less than the threshold of 100ms, and PA-2 can be retrieved.
[0076] Processing of the message corresponding to event PA-1 is completed and the message corresponding to the next event (event PA-2) in the first queue 322A is retrieved. The message from the first queue 322A may contain another event, such as event PA-3 with a timestamp of 20:00:00.180. The timestamp of each event corresponding to the message to the front of each queue can be determined. The time difference between the timestamp corresponding to event PC-1 (20:00:00.250) and the timestamp corresponding to event PA-3 (20:00:00.180) is 70ms, which does not exceed the threshold of 100ms. This allows consumer 332C to retrieve a message containing event PC-1, which corresponds to the target queue, in this case the third queue 322C.
[0077] In some embodiments, the threshold is determined dynamically. It can be based on the number of messages in the queue, the relative processing time of the messages in the queue, the time difference between the timestamps of the messages, and / or any other similar factors. For example, the threshold can be the average of the difference between the timestamps of the first and second messages in each queue. As another example, the threshold can be the message with the longest processing time (e.g., 00:00.100) plus a pre-time period (e.g., x+00:00.150) in any queue. Therefore, if the longest processing time of the messages in the queue is 00:00.100, the threshold will be 00:00.2500.
[0078] The above example can be extended to group more than one topic (and thus corresponding queues). In this embodiment, each group identifier can be given to associate consumers between each topic.
[0079] As a further example, Figure 6 As shown, embodiments may include a computer system 70, which may form part of a networked system 7. Components of the computer system / server 70 may include, but are not limited to, one or more processing arrangements, such as a processor or processing unit 71, a system memory 74, and a bus 90 coupling various system components (including the system memory 74) to the processing unit 71.
[0080] The processing unit 71 is used to define a target object type, and the target object type is used to store the result of the middleware function. In addition, the processing unit 71 is configured to receive a first object for an application, and then use the first object to perform processing of the middleware function to generate a processing result. The processing unit 71 is used to generate a second object of the target object type according to the processing result, and provide the second object to the application.
[0081] Bus 90 represents any one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example and not limitation, such architectures include an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an Enhanced ISA (EISA) bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0082] The computer system / server 70 typically includes a variety of computer system readable media. Such media can be any available media that can be accessed by the computer system / server 70, and it includes volatile and non-volatile media, removable and non-removable media.
[0083] The system memory 74 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 75 and / or cache memory 76. The computer system / server 70 may also include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 74 may be provided for reading and writing from a non-removable non-volatile magnetic medium (not shown, and generally referred to as a "hard drive"). Although not shown, a disk drive for reading from or writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM or other optical media) may be provided. In such a case, each may be connected to the bus 90 via one or more data media interfaces. As will be further depicted and described below, the memory 74 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of an embodiment of the present disclosure.
[0084] A program / utility 78 having a set (at least one) of program modules 79, as well as an operating system, one or more application programs, other program modules, and program data, may be stored in the memory 74 by way of example and not limitation. Each or some combination of the operating system, one or more application programs, other program modules, and program data may include an implementation of a network environment. The program modules 79 generally perform the functions and / or methods of embodiments of the present disclosure as described herein.
[0085] The computer system / server 70 may also communicate with one or more external devices 80 (e.g., keyboard, pointing device, display 85, etc.); and / or any device that enables the computer system / server 70 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may occur via input / output (I / O) interface 72. In addition, the computer system / server 70 may communicate with one or more networks such as a local area network (LAN), a general wide area network (WAN), and / or a public network (e.g., the Internet) via a network adapter 73. As shown, the network adapter 73 communicates with other components of the computer system / server 70 via a bus 90. It should be understood that, although not shown, other hardware and / or software components may be used in conjunction with the computer system / server 70. Examples include, but are not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data archiving storage systems, etc.
[0086] In the context of this application, when the embodiments of the present disclosure constitute a method, it should be understood that such a method is a process for being executed by a computer, that is, a computer-implementable method. Therefore, the various steps of the method reflect various parts of a computer program, for example, various parts of one or more algorithms.
[0087] The present disclosure may be a system, method, and / or computer program product. The computer program product may include a computer-readable storage medium (or media) having computer-readable program instructions thereon for causing a processor to perform aspects of the present invention.
[0088] Computer readable storage media can be a tangible device that can retain and store instructions for use by instruction execution devices. Computer readable storage media can be, for example but not limited to, electronic storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the above. A non-exhaustive list of more specific examples of computer readable storage media includes the following: portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), storage class memory (SCM), static random access memories (SRAM), portable compact disc read-only memories (CD-ROM), digital versatile disks (DVD), memory sticks, floppy disks, mechanical encoding devices with protruding structures such as punch cards or grooves with instructions recorded thereon, and any suitable combination of the above. Computer readable storage media as used herein should not be interpreted as temporary signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagated by waveguides or other transmission media (e.g., light pulses passing through fiber optic cables) or electrical signals emitted by wires.
[0089] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to a corresponding computing / processing device via a network (e.g., the Internet, a local area network, a wide area network, and / or a wireless network), or downloaded to an external computer or external storage device. The network can include copper transmission cables, optical transmission fibers, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in a computer-readable storage medium in the corresponding computing / processing device.
[0090] The computer-readable program instructions for performing the operation of the present disclosure can be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages (such as Smalltalk, C++, etc.) and conventional procedural programming languages (such as "C" programming languages or similar programming languages). The computer-readable program instructions can be executed completely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer, partially on the remote computer, or completely on the remote computer or server. In the latter case, the remote computer can be connected to the user's computer through any type of network (including local area network (LAN) or wide area network (WAN)), or can be connected to an external computer (for example, using an Internet service provider through the Internet). In some embodiments, the electronic circuit including, for example, a programmable logic circuit, a field programmable gate array (FPGA) or a programmable logic array (PLA) can perform computer-readable program instructions by utilizing the state information of the computer-readable program instructions to personalize the electronic circuit so as to perform various aspects of the present disclosure.
[0091] Various aspects of the present disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of boxes in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0092] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device create a device for implementing the functions / actions specified in one or more boxes of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, which causes the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable storage medium in which the instructions are stored includes a manufactured product containing instructions for implementing aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0093] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device, so that a series of operational steps are performed on the computer, other programmable apparatus, or other device to produce computer-implemented processing, so that the instructions executed on the computer, other programmable apparatus, or other device implement the functions / actions specified in or in multiple boxes in the flowchart and / or block diagram.
[0094] The flow charts and block diagrams in the accompanying drawings illustrate the architecture, functions and operations of possible implementations of the systems, methods and computer program products according to different embodiments of the present disclosure. To this end, each box in the flow chart or block diagram may represent a module, segment or part of an instruction, which includes one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the box may not occur in the order marked in the figure. For example, depending on the functions involved, the two blocks shown in succession may actually be executed substantially simultaneously, or the blocks may sometimes be executed in reverse order. It should also be noted that each box in the block diagram and / or flow chart, and the combination of boxes in the block diagram and / or flow chart, can be implemented with a dedicated hardware-based system that performs a specified function or action or performs a combination of dedicated hardware and computer instructions.
[0095] The description of different embodiments of the present disclosure has been presented for illustrative purposes, but is not intended to be exhaustive or limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terms used herein are selected to best explain the principles of the embodiments, practical applications, or technical improvements to technologies found in the marketplace, or to enable those of ordinary skill in the art to understand the embodiments disclosed herein.
[0096] In summary, various embodiments have been discussed, which are again illustrated in the following numbered examples:
[0097] Embodiment 1 is as follows. A computer-implemented method for processing a message stream, the method comprising: obtaining a plurality of messages of the message stream, each message having an associated timestamp; storing each message in at least one of a plurality of queues, wherein the messages of each queue are sorted based on their timestamps so that the message with the earliest timestamp is at the front of the queue; and controlling retrieval of the target message from the front of the target queue based on a time difference between the timestamp of the target message and the timestamp of the front message of each queue in the plurality of queues excluding the target queue.
[0098] Embodiment 2 is as follows. The method according to embodiment 1, wherein controlling the retrieval comprises: for each of the other queues, determining the time difference between the timestamp of the target message and the previous message of the queue; identifying the maximum value of the time difference from the determined time differences; and allowing the retrieval of the target message from the target queue based on whether the maximum value of the time difference exceeds a threshold.
[0099] Embodiment 3 is as follows: The method of embodiment 1 or 2, wherein allowing the target message to be retrieved comprises: if the maximum value of the time difference is less than a threshold value, allowing the target message to be retrieved from the target queue.
[0100] Embodiment 4 is as follows: The method according to any one of the aforementioned examples further comprises: refusing to retrieve the message from the target queue if the maximum value of the time difference exceeds a threshold; and generating an error message in response to refusing to retrieve the message from the target queue.
[0101] Embodiment 5 is as follows: The method according to any one of the preceding examples further comprises: in response to retrieval of the message from the target queue being rejected, generating an error message.
[0102] Embodiment 6 is as follows: The method according to any one of the preceding examples further comprises: delaying retrieval of the message from the rejected target queue.
[0103] Embodiment 7 is as follows. The method according to any one of the foregoing examples further includes: determining that the message associated with the longest value is no longer in its associated queue; identifying the remaining maximum value of the time difference from the determined time difference; and allowing the target message to be retrieved from the target queue if the remaining maximum value of the time difference is less than the threshold.
[0104] Embodiment 8 is as follows: The method according to any one of the preceding examples further comprises: receiving an input signal indicating a time alignment requirement; and determining the threshold based on the received input signal.
[0105] Embodiment 9 is as follows: The method according to any one of the preceding examples, wherein the threshold is equal to an average value of the first message and the second message in each queue.
[0106] Embodiment 10 is as follows: The method according to any one of the preceding examples further comprises, for each obtained message: generating a timestamp indicating a time associated with the message; and associating the generated timestamp with the message.
[0107] Embodiment 11 is as follows. A method according to any of the foregoing examples, wherein: each message is related to at least one topic of a plurality of topics; the method further comprises: for each of the plurality of topics, defining a plurality of queues associated with at least one topic; and storing each message in at least one of the plurality of queues comprises: storing each message in at least one of the plurality of queues associated with the topic to which the message relates.
[0108] Embodiment 12 is as follows. A computer program product for processing a message stream, the computer program product comprising a computer-readable storage medium having program instructions contained therein, the program instructions being executable by a processing unit to cause the processing unit to: obtain messages of the message stream, each message having an associated timestamp; store each message in at least one of a plurality of queues, wherein the messages of each queue are sorted based on their timestamps so that the message with the earliest timestamp is at the front of the queue; and control retrieval of the target message from the front of the target queue based on a time difference between the timestamp of the target message and the timestamp of the front message of each queue in the other queues of the plurality of queues.
[0109] Embodiment 13 is as follows: The computer program product according to embodiment 12, wherein the program instructions are further configured to cause the processing unit to: for each of the other queues, determine the time difference between the timestamp of the target message and the previous message of each queue; and identify the maximum value of the time difference according to the determined time difference.
[0110] Embodiment 14 is as follows: The computer program product according to embodiment 12 or 13, wherein the program instructions are further configured to cause the processing unit to: if the maximum value of the time difference is less than a threshold value, allow the target message to be retrieved from the target queue.
[0111] Embodiment 15 is as follows: A computer program product according to any one of embodiments 12 to 14, wherein the program instructions are further configured to cause the processing unit to: refuse to retrieve the message from the target queue if the maximum value of the time difference exceeds a threshold; and generate an error message in response to refusing to retrieve the message from the target queue.
[0112] Embodiment 16 is as follows. A system for processing a message stream, the system comprising: an interface configured to obtain messages of the message stream, each message having an associated timestamp; a queue component configured to store each message in at least one queue of a plurality of queues, wherein the messages of each queue are sorted based on their timestamps so that the message with the earliest timestamp is at the front of the queue; and a message retrieval component configured to control retrieval of the target message from the front of the target queue based on a time difference between the timestamp of the target message and the timestamp of the front message of each of the other queues of the plurality of queues that are not the target queue.
[0113] Embodiment 17 is as follows. A system according to embodiment 16, wherein the message retrieval component is configured to: for each queue in the other queues, determine the time difference between the timestamp of the target message and the previous message of the queue; identify the maximum value of the time difference from the determined time differences; and based on whether the maximum value of the time difference exceeds a threshold, allow the target message to be retrieved from the requested queue.
[0114] Embodiment 18 is as follows: The system according to embodiment 16 or 17, wherein the message retrieval component is configured to: if the maximum value of the time difference does not exceed a threshold, allow the target message to be retrieved from the requested queue.
[0115] Embodiment 19 is as follows: The system according to any one of embodiments 16 to 18, wherein the message retrieval component is further configured to generate an error message in response to refusing to retrieve the target message from the requested queue if the maximum value of the time difference exceeds a threshold.
[0116] Embodiment 20 is as follows. The system according to any one of embodiments 16 to 19 further comprises: an alignment configuration component configured to receive an input signal indicating a time alignment requirement and determine the threshold based on the received input signal.
[0117] Embodiment 21 is as follows: The system according to any one of embodiments 16 to 20, further comprising: a time component configured to generate, for each acquired message, a timestamp indicating a time associated with the message and to associate the generated timestamp with each message.
[0118] Embodiment 22 is as follows. A system according to any one of embodiments 16 to 21, wherein each message is related to at least one topic of a plurality of topics, wherein the queue component is further configured to define a plurality of queues associated with each topic of the plurality of topics; and wherein the queue component is further configured to store each message in each queue of the plurality of queues associated with the topic to which the message relates.
[0119] Example 23 is as follows: The system according to any one of examples 16 to 22, wherein the threshold is defined by a user.
[0120] Embodiment 24 is as follows. A computer-implemented method for processing a message stream, the method comprising: obtaining messages of the message stream, each message having an associated timestamp, wherein each message is associated with at least one of a plurality of topics; defining a plurality of queues associated with at least one topic; and storing each message in at least one of the plurality of queues associated with the at least one topic, each message being associated with the at least one topic; storing each message in at least one of the plurality of queues, wherein the messages of each queue are sorted based on their timestamps such that the message with the earliest timestamp is at the front of the queue; generating a timestamp representing a time associated with the message; and storing the generated timestamp in at least one of the plurality of queues associated with the at least one topic. A timestamp is associated with the message; based on the time difference between the timestamp of the target message and the timestamp of the front message of each queue in the multiple queues excluding the target queue, controlling the retrieval of the target message from the front of the target queue; for each queue in the other queues, determining the time difference between the timestamp of the target message and the front message of the queue; identifying the maximum value of the time difference based on the determined time difference; receiving an input signal indicating a time alignment requirement; determining the threshold value based on the received input signal; and allowing the retrieval of the target message from the target queue in response to the maximum value of the time difference being less than the threshold value.
[0121] Embodiment 25 is as follows. A system comprising: a processor; and a computer-readable storage medium, which is communicatively coupled to the processor and stores program instructions, the program instructions being configured to cause the processor when executed by the processor to: obtain messages of a message stream, each message having an associated timestamp, wherein each message is associated with at least one of a plurality of topics; define a plurality of queues associated with at least one topic; and store each message in at least one of the plurality of queues associated with the at least one topic, each message being associated with the at least one topic; store each message in at least one of the plurality of queues, wherein the messages of each queue are sorted based on their timestamps so that the message with the earliest timestamp is at the front of the queue; generate a timestamp representing a time associated with the message; associate the generated timestamp with the message; Based on the time difference between the timestamp of the target message and the timestamp of the front message of each queue in the other queues of the multiple queues excluding the target queue, control the retrieval of the target message from the front of the target queue; for each queue in the other queues, determine the time difference between the timestamp of the target message and the front message of the queue; identify the maximum value of the time difference based on the determined time difference; receive an input signal indicating a time alignment requirement; determine the threshold value based on the received input signal; delay retrieval of the message from the rejected target queue; determine that the message associated with the maximum value is no longer in its associated queue; identify the remaining maximum value of the time difference from the determined time difference; and if the remaining maximum value of the time difference is less than the threshold value, allow retrieval of the target message from the target queue.
Claims
1. A computer-implemented method for processing a message stream, the method comprising: A plurality of messages of a message stream is obtained, each message having an associated timestamp; storing each message in at least one of a plurality of queues, wherein the messages of each queue are ordered based on their timestamps such that the message with the earliest timestamp is at the front of the queue; and controlling retrieval of the target message from the front of the target queue based on a time difference between a timestamp of the target message and a timestamp of a front message of each of the other queues excluding the target queue among the plurality of queues, wherein the timestamp of the front message of each of the other queues is earlier than the timestamp of the target message; Among them, controlling the retrieval includes: for each queue in the other queues, determining the time difference between the timestamp of the target message and the front message of the queue; identifying the maximum value of the time difference from the determined time differences; and based on whether the maximum value of the time difference exceeds a threshold, allowing the target message to be retrieved from the target queue.
2. The method according to claim 1, wherein: Allowing retrieval of the target message includes: If the maximum value of the time difference is smaller than the threshold, retrieving the target message from the target queue is allowed.
3. The method according to claim 1, further comprising: If the maximum value of the time difference exceeds the threshold, refusing to retrieve the target message from the target queue; as well as In response to retrieval of the target message from the target queue being rejected, an error message is generated.
4. The method according to claim 1, further comprising: Delaying retrieval of the target message from the rejected target queue.
5. The method according to claim 4, further comprising: determining that a message associated with the maximum value is no longer in its associated queue; identifying a remaining maximum value of the time differences from the determined time differences; as well as If the remaining maximum value is less than the threshold value, retrieving the target message from the target queue is allowed.
6. The method according to claim 1, further comprising: receiving an input signal indicative of a time alignment requirement; as well as The threshold is determined based on the received input signal.
7. The method according to claim 1, wherein: The threshold is equal to the average of the differences between the timestamps of the previous message and the next message of the previous message in each queue.
8. The method according to claim 1 further comprises, for each obtained message: generating a timestamp representing a time associated with the message; and The generated timestamp is associated with the message.
9. The method according to claim 1, wherein: Each message is associated with at least one of the plurality of topics; The method further includes: for each topic in the plurality of topics, defining a plurality of queues associated with at least one topic; and Storing each message in at least one of the plurality of queues includes storing each message in at least one of the plurality of queues associated with a topic to which the message relates.
10. A computer program product for processing a message stream, the computer program product comprising program instructions executable by a processing unit to cause the processing unit to: A plurality of messages of a message stream is obtained, each message having an associated timestamp; storing each message in at least one of a plurality of queues, wherein the messages of each queue are ordered based on their timestamps such that the message with the earliest timestamp is at the front of the queue; and Controlling retrieval of the target message from the front of the target queue based on a time difference between the timestamp of the target message and the timestamp of the front message of each of the other queues of the plurality of queues, wherein the timestamp of the front message of each of the other queues is earlier than the timestamp of the target message; Wherein, the program instructions are further configured to enable the processing unit to: determine, for each queue in the other queues, the time difference between the timestamp of the target message and the previous message of the queue; identify the maximum value of the time difference from the determined time differences; and based on whether the maximum value of the time difference exceeds a threshold, allow the target message to be retrieved from the target queue.
11. The computer program product according to claim 10, wherein: The program instructions are further configured to cause the processing unit to: If the maximum value is less than the threshold value, retrieving the target message from the target queue is allowed.
12. The computer program product of claim 10, wherein: The program instructions are further configured to cause the processing unit to: If the maximum value of the time difference exceeds the threshold, refusing to retrieve the target message from the target queue; as well as In response to retrieval of the target message from the target queue being rejected, an error message is generated.
13. A system for processing a message stream, the system comprising: An interface configured to obtain a plurality of messages of a message stream, each message having an associated timestamp; a queue component configured to store each message in at least one of a plurality of queues, wherein the messages of each queue are ordered based on their timestamps such that the message with the earliest timestamp is at the front of the queue; and a message retrieval component configured to control retrieval of the target message from the front of the target queue based on a time difference between a timestamp of the target message and a timestamp of a front message of each of the other queues that are not the target queue, wherein the timestamp of the front message of each of the other queues is earlier than the timestamp of the target message; Among them, the message retrieval component is configured to: for each queue in other queues, determine the time difference between the timestamp of the target message and the previous message of the queue; identify the maximum value of the time difference from the determined time differences; and based on whether the maximum value of the time difference exceeds a threshold, allow the target message to be retrieved from the target queue.
14. The system according to claim 13, wherein: The message retrieval component is configured to: If the maximum value does not exceed the threshold value, retrieving the target message from the requested queue is allowed.
15. The system of claim 14, wherein: The message retrieval component is further configured to generate an error message in response to denying retrieval of the target message from the requested queue if the maximum value of the time difference exceeds the threshold.
16. The system of claim 14, further comprising: An alignment configuration component is configured to receive an input signal representing a time alignment requirement and to determine the threshold based on the received input signal.
17. The system of claim 13, further comprising: A time component is configured to generate, for each obtained message, a time stamp representing a time associated with the message and to associate the generated time stamp with the message.
18. The system of claim 13, wherein: Each message is associated with at least one of the multiple topics. wherein the queue component is further configured to define, for each of the plurality of topics, a plurality of queues associated with the topic; and Wherein, the queue component is further configured to store each message in each of the plurality of queues associated with a topic related to the message.
19. The system of claim 13, wherein: The user defines the threshold.
20. A computer-implemented method for processing a message stream, the method comprising: Obtaining a plurality of messages of a message stream, each message having an associated timestamp, wherein each message is associated with at least one topic of a plurality of topics; Define multiple queues associated with at least one topic; as well as storing each message in at least one of a plurality of queues associated with at least one topic associated with each message; storing each message in at least one of a plurality of queues, wherein the messages of each queue are ordered based on their timestamps such that the message with the earliest timestamp is at the front of the queue; generating a timestamp representing a time associated with the message; associating the generated timestamp with the message; controlling retrieval of the target message from the front of the target queue based on a time difference between a timestamp of the target message and a timestamp of a front message of each of the other queues of the plurality of queues excluding the target queue; For each of the other queues, determining a time difference between the timestamp of the target message and a preceding message of the queue; identifying a maximum value of the time differences from the determined time differences; receiving an input signal indicative of a time alignment requirement; determining a threshold based on the received input signal; and In response to the maximum value of the time differences being smaller than the threshold, allowing the target message to be retrieved from the target queue.
21. A computer system comprising: processor; as well as A computer-readable storage medium is communicatively coupled to the processor and stores program instructions that, when executed by the processor, are configured to cause the processor to: Obtaining a plurality of messages of a message stream, each message having an associated timestamp, wherein each message is associated with at least one topic of a plurality of topics; Define multiple queues associated with at least one topic; as well as storing each message in at least one of a plurality of queues associated with at least one topic associated with each message; storing each message in at least one of a plurality of queues, wherein the messages of each queue are ordered based on their timestamps such that the message with the earliest timestamp is at the front of the queue; generating a timestamp representing a time associated with the message; associating the generated timestamp with the message; controlling retrieval of the target message from the front of the target queue based on a time difference between a timestamp of the target message and a timestamp of a front message of each of the other queues of the plurality of queues excluding the target queue; For each of the other queues, determining a time difference between the timestamp of the target message and a previous message of the queue; identifying a maximum value of the time differences from the determined time differences; receiving an input signal indicative of a time alignment requirement; determining a threshold based on the received input signal; In response to the maximum value of the time difference exceeding the threshold, refusing to retrieve the target message from the target queue; delaying the retrieval of the target message from the rejected target queue; determining that a message associated with the maximum value is no longer in its associated queue; identifying a remaining maximum value of the time differences from the determined time differences; and If the remaining maximum value of the time difference is smaller than the threshold, retrieving the target message from the target queue is allowed.
