Delay message processing system, method, equipment and medium
Through the combination of a delay scheduler and a multi-level delay processing module, the problem that delayed message processing solutions in the existing technology cannot meet a large number of delay time requirements is solved, and precise delay processing and high-accuracy delivery of delayed messages are achieved.
Patent Information
- Application Number
- CN202411482086.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-01-24
AI Technical Summary
In the prior art, the delay message processing scheme adopts a time round or similar cyclic scheduling mechanism, resulting in a fixed time interval design that cannot meet the demand for a large number of delay time, thereby reducing the delivery accuracy of delayed messages.
The combination scheme of the delay scheduler and the multi -stage delay processing module is adopted to receive and judge the expiration time of the delayed message through the delay scheduler, and submit the unpreparted messages to the multiple -level delay processing module for delay processing. Each level of delay processing module processes the message of different message delay level requirements, and returns the processing message back to the delay scheduler.
Through multiple scheduling delay processing modules at different levels, accurate delay processing of delay messages is achieved, and the accuracy of delay message delivery is improved.
Smart Images

Figure CN119363550A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a delayed message processing system, method, device and medium. Background Art
[0002] With the rapid development of Internet business, in many application scenarios, immediate message processing is not the best choice. For example, scenarios such as system retry mechanism, task timing execution mechanism and e-commerce order processing all require the use of delayed message processing mechanism.
[0003] Most of the delayed message processing solutions in related technologies use time wheels or similar circular scheduling mechanisms to process delayed messages. Such processing mechanisms usually use fixed time slots or time intervals to determine when the message is consumed. However, the design of such fixed time intervals is limited by hardware performance and often cannot apply a large number of delay duration requirements, which leads to low delivery accuracy of delayed messages. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a delayed message processing system, method, device and medium to improve the delivery accuracy of delayed messages.
[0005] In a first aspect, an embodiment of the present application provides a delayed message processing system, the system comprising: a delayed scheduler and a delayed message cluster communicating with the delayed scheduler, wherein:
[0006] The delay scheduler is used to receive the delay message sent by the delay message producer and the delay message cluster, and judge whether the delay message has expired according to the current time and the message expiration time of the delay message, and when the delay message has not expired, deliver the delay message to the delay message cluster;
[0007] The delayed message cluster includes a multi-level delay processing module and a delayed message return module. The multi-level delay processing modules respectively perform delay processing on the delayed messages with different message delay level requirements. After the target delay processing module completes the delay processing of the delayed message, the delayed message return module returns the delayed message to the delay scheduler.
[0008] Among them, the target delay processing module is the delay processing module with the maximum module delay level among the delay processing modules whose module delay level is not greater than the message delay level in the current delayed message cluster; the message delay level is determined based on the message delay time of the delayed message; and the message delay time is determined based on the current time and the message expiration time.
[0009] In the implementation process of the above scheme, the delayed message cluster includes a multi-level delay processing module, each level of the delay processing module performs delay processing on the delayed messages with different message delay level requirements, and returns the delayed messages after delay processing to the delay scheduler. The delay scheduler can judge whether the delayed message has expired according to the message expiration time of the delayed message returned by the delayed message cluster. If the delayed message has not expired yet, the delayed message will be resent to the delayed message cluster so that the delayed message cluster continues to perform delay processing on the delayed message. Compared with the scheme of using a time wheel to implement delay processing in the related technology, the above scheme uses a delay scheduler and a multi-level delay processing module to perform delay processing on the delayed message. For the same delayed message, the delay scheduler can implement accurate delay processing of the delayed message by scheduling delay processing modules of different levels multiple times, which is beneficial to improving the message delivery rate of the delayed message.
[0010] In an implementation of the first aspect, the delay processing module includes:
[0011] a target index group determining unit, configured to determine, among the index groups corresponding to the target delay processing module and whose index delay time is not greater than the message delay time, the index group having the largest index delay time as the target index group;
[0012] An index unit construction unit is used to construct an index unit for the delayed message based on the index expiration time of the delayed message and the original message displacement, and add the index unit to the target index group; wherein the index expiration time is determined based on the current time and the index delay time corresponding to the target index group.
[0013] During the implementation of the above scheme, the delay processing module uses the index group to locate and delay the delayed message, so that the above delayed message processing system can quickly and accurately find and process the corresponding delayed message according to the index expiration time. On the one hand, it is beneficial to improve the delayed message delivery accuracy of the above delayed message processing system; on the other hand, the index expiration time of the index units in each index group is arranged in ascending order, following the first-in-first-out principle, so as to realize the sequential consumption of delayed messages. The above delayed message processing system can quickly confirm which delayed messages have reached the index expiration time, which is beneficial to improve the delay processing pressure of the delayed message processing system.
[0014] In an implementation manner of the first aspect, the delayed message cluster further includes:
[0015] An expiration scanning module is used to use a scanning thread to scan the index expiration time of the index unit in the index group, and determine whether the delay message corresponding to the index unit has expired based on the current time and the index expiration time, and return the delay message to the delay scheduler when the index expiration time expires.
[0016] In the implementation process of the above scheme, the index group is scanned by thread scanning to determine whether the delayed message has reached the index expiration time. On the one hand, through the thread scanning method, the above delayed message processing system can quickly locate the delayed message that has reached the index expiration time, which is beneficial to improving the query efficiency of the above delayed message processing system when querying the delayed message that has reached the index expiration time; on the other hand, since the index units in the index group are arranged in order according to the index expiration time, only one or more index units at the front position in the index group can be scanned during thread scanning, which is beneficial to further improve the query efficiency; on the other hand, through the thread scanning combined with the index group method, it is beneficial to reduce the IO overhead of the above delayed message processing system.
[0017] In an implementation of the first aspect, the delayed message cluster includes: multiple levels of delayed message sub-clusters, and the multiple levels of delayed message sub-clusters are respectively used to delay the delay messages with different cluster delay level requirements, and return the delayed messages after delay processing to the delay scheduler; wherein, the cluster delay level includes at least one of seconds, minutes, hours and days.
[0018] In the process of implementing the above scheme, a multi-level delayed message sub-cluster is set up to perform delay processing on delayed messages with different cluster delay level requirements respectively. On the one hand, it is beneficial to improve the delayed message processing capability of the above-mentioned delayed message processing system and realize the expansion of the system's delayed message processing capability; on the other hand, the multi-level delayed message sub-cluster can share the load, which is beneficial to improve the cluster load pressure, thereby improving the stability and reliability of the above-mentioned delayed message processing system.
[0019] In an implementation manner of the first aspect, the delay scheduler includes:
[0020] A first allocation module is configured to determine the message delay time based on the current time and the message expiration time of the delayed message, determine the cluster delay level of the delayed message based on the message delay time, and deliver the delayed message to the corresponding delayed message sub-cluster.
[0021] In the implementation process of the above scheme, in each allocation process of delayed messages, the first allocation module redetermines the message delay time based on the current time and the message expiration time, and then allocates the delayed messages based on the redetermined message delay time. That is, in each allocation process of delayed messages, the message delay time is corrected based on the current time and the message expiration time, thereby improving the accuracy of delayed message delivery at each allocation, and further improving the accuracy of delayed message delivery by the above delayed message processing system.
[0022] In an implementation of the first aspect, the delayed message cluster includes: a plurality of delayed message subclusters; wherein each of the delayed message subclusters is configured with a load balancing weight, and the load balancing weight is used to indicate the probability that the delayed message is delivered to the delayed message subcluster;
[0023] The delay scheduler comprises:
[0024] A second allocation module is used to deliver the delayed message based on the load balancing weight.
[0025] In the process of implementing the above scheme, in each delivery process of the delayed message, the second allocation module in the delay scheduler delivers the delayed message based on the load balancing weight, and the load balancing weight is used to indicate the probability of the delayed message being delivered to the delayed message sub-cluster. On the one hand, the delayed message allocation scheme based on the load balancing weight enables the delay scheduler to reasonably allocate the delayed messages, which is conducive to reducing the probability of cluster overload, thereby helping to improve the overall processing capacity of the above-mentioned delayed message processing system; on the other hand, the load balancing allocation scheme is conducive to improving the overall resource utilization of the delayed message cluster.
[0026] In a second aspect, an embodiment of the present application provides a delayed message processing method, which is applied to a delayed message cluster, and the method includes: receiving a delayed message sent by a delayed scheduler; determining a message delay time of the delayed message based on a current time and a message expiration time of the delayed message; determining a message delay level of the delayed message based on the message delay time; in the delay processing module corresponding to the current delayed message cluster and whose module delay level is not greater than the message delay level, determining the delay processing module with the maximum module delay level as a target delay processing module; performing delay processing on the delayed message using the target delay processing module; and returning the delayed message after delay processing to the delay scheduler using a delayed message return module.
[0027] In the third aspect, an embodiment of the present application provides a delayed message processing method, which is applied to a delayed scheduler, and the method includes: receiving a delayed message sent by a delayed message producer; judging whether the delayed message has expired based on the current time and the message expiration time of the delayed message; if the delayed message has not expired, delivering the delayed message to the delayed message cluster, so that the delayed message cluster performs delay processing on the delayed message and re-delivers the delayed message after delay processing to the delay scheduler; after receiving the delayed message returned by the delayed message cluster, re-judging whether the delayed message has expired, and re-executing the delayed message delivery step if the delayed message has not expired, until the delayed message expires.
[0028] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory, and a communication bus, wherein the processor and the memory communicate with each other through the communication bus; the memory stores computer program instructions that can be executed by the processor, and when the computer program instructions are read and run by the processor, the method provided by the second aspect or any possible implementation of the second aspect or the third aspect or any possible implementation of the third aspect is executed.
[0029] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are read and run by a processor, the method provided by the second aspect or any possible implementation of the second aspect or the third aspect or any possible implementation of the third aspect is executed.
[0030] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the embodiments of the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0032] Figure 1 A schematic diagram of the architecture of a delayed message processing system provided in an embodiment of the present application;
[0033] Figure 2A schematic diagram of the architecture of a delay processing module provided in an embodiment of the present application;
[0034] Figure 3 A schematic diagram of a delay processing process of a delayed message provided in an embodiment of the present application;
[0035] Figure 4 A schematic diagram of a process of processing a delayed message by a delayed message processing system provided in an embodiment of the present application;
[0036] Figure 5 A schematic diagram of the structure of a multi-stage delayed message sub-cluster provided in an embodiment of the present application;
[0037] Figure 6 A schematic diagram of the allocation process for delayed message allocation based on load balancing weights provided in an embodiment of the present application;
[0038] Figure 7 A schematic diagram of the structure of a delayed message processing system including a business message cluster provided in an embodiment of the present application;
[0039] Figure 8 A flowchart of a delayed message processing method applied to a delayed message cluster provided in an embodiment of the present application;
[0040] Fig. 9 A schematic diagram of a process flow of a delayed message processing method applied to a delayed scheduler provided in an embodiment of the present application;
[0041] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] The following will describe the technical solutions in the embodiments of the present application in conjunction with the accompanying drawings in the embodiments of the present application. The following embodiments are only used to more clearly illustrate the technical solutions of the present application, and are therefore only used as examples, and cannot be used to limit the scope of protection of the present application.
[0043] With the rapid development of Internet business, in many application scenarios, processing messages immediately is not the best choice, for example:
[0044] (1) Retry mechanism: When an operation fails, the system may need to retry after a period of time. Delayed messages can be used for this retry mechanism to avoid frequent immediate retry operations that cause system overload.
[0045] (2) Scheduled tasks: Some tasks need to be executed at a specific time point rather than immediately. Delayed messages can be used to schedule these tasks.
[0046] (3) E-commerce order processing: In e-commerce systems, orders may need to be automatically canceled or processed after a certain period of time. Delayed messages can be used to implement this type of business logic.
[0047] At present, most related technologies use the time wheel technology to process delayed messages. The time wheel is a data structure used to implement timed task scheduling. In the delayed message processing solution, the time wheel is used to manage delayed messages. The time wheel is usually a cyclic data structure, including multiple slots or buckets. Each slot represents a time interval, for example, each slot represents a 1-second interval. The delayed message will be placed in the slot corresponding to the arrival of the delay time. When the time wheel rotates to this slot, the corresponding delayed message will be triggered for execution.
[0048] Due to the limitation of hardware performance, the number of slots set in the timing wheel will be limited. On the one hand, it is difficult for the timing wheel to accurately represent the delay time of any length. For these delayed messages that are difficult to accurately express the delay time, the delay scheme using the timing wheel will lead to a decrease in the accuracy of message delivery. On the other hand, the delay scheme using the timing wheel will rely on the system processing capability. When the system load is high, the delayed messages cannot be processed in time. Even if the timing wheel rotates accurately, the delivery accuracy of the delayed messages will still be reduced.
[0049] In summary, the message delivery accuracy of the scheme using a time wheel or a similar cyclic scheduling mechanism to process delayed messages in the related art is low. Based on this, an embodiment of the present application provides a delayed message processing system, which includes a delay scheduler and a delayed message cluster, wherein the delayed message cluster includes a multi-level delay processing module, each level of delay processing module respectively delays the delayed messages with different message delay level requirements, and returns the delayed messages after delay processing to the delay scheduler, and the delay scheduler can judge whether the delayed message has expired according to the message expiration time of the delayed message returned by the delayed message cluster. If the delayed message still has not expired, the delayed message is resent to the delayed message cluster so that the delayed message cluster continues to delay the delayed message. Compared with the scheme using a time wheel to implement delay processing in the related art, the above scheme uses a delay scheduler and a multi-level delay processing module to delay the delayed message. For the same delayed message, the delay scheduler can implement accurate delay processing of the delayed message by scheduling delay processing modules of different levels multiple times, which is conducive to improving the message delivery rate of the delayed message.
[0050] The following is a detailed description of the above delayed message processing system. Figure 1 , an embodiment of the present application provides a delayed message processing system 100, the system comprising:
[0051] The delay scheduler 110 is used to receive the delay message sent by the delay message producer and the delay message cluster, and judge whether the delay message has expired according to the current time and the message expiration time of the delay message. When the delay message has not expired, the delay message is re-delivered to the delay message cluster; when the delay message expires, the delay message is delivered to the delay message consumer so that the delay message consumer consumes the delay message;
[0052] The delayed message cluster 120 includes:
[0053] A multi-level delay processing module 121, each level of the delay processing module 121 respectively performs delay processing on delay messages with different message delay level requirements, and after completing the delay processing of the delay message using the target delay processing module, the delay message is sent to the delay message return module 122;
[0054] The delayed message return module 122 is used to receive the delayed message after the target delay processing module completes the delay processing, and return the delayed message to the delay scheduler. The target delay processing module is the delay processing module with the largest module delay level among the delay processing modules whose module delay level is not greater than the message delay level in the current delayed message cluster 120; the message delay level is determined based on the message delay time of the delayed message; the message delay time is determined based on the current time and the message expiration time.
[0055] The above-mentioned delayed message producer refers to the business process or component that generates delayed messages. When the producer needs it, it will create a delayed message and set the delayed message delay time so that the delayed message can be processed at a certain point in the future. The delayed message consumer refers to the business process or component that is triggered and executes the corresponding business logic after the delayed message expires. After the delayed message expires, the consumer obtains the delayed message and triggers specific business execution logic according to the delayed message content.
[0056] The above-mentioned delayed message cluster 120 refers to a message processing cluster specifically responsible for processing delayed messages. This cluster receives delayed messages forwarded by the delayed scheduler 110, and stores, schedules and manages them. It can be understood that from the perspective of software implementation, the above-mentioned delayed message cluster 120 can be implemented by message middleware such as RabbitMQ, Kafka and RocketMQ, or by using a database; from the perspective of hardware implementation, the above-mentioned delayed message cluster 120 can be implemented using centralized devices or distributed devices, such as server clusters, computing clusters, cloud computing platforms, edge computing devices and dedicated hardware devices.
[0057] It is understandable that the above-mentioned delay processing module 121 can be deployed in a device with delay processing capability in the cluster, and the delay message return module 122 can be deployed in a device with delay message sending capability in the cluster. Of course, a delay message scheduling module can also be set in the access node of the delay message cluster 120, and the module is used to send the delay message to the device with delay processing capability in the cluster, so that the delay processing module 121 deployed in the device performs delay processing on the delay message.
[0058] The module delay level of the delay processing module 121 is introduced below:
[0059] Generally, delayed messages are mostly at the second level, minute level, hour level and day level. Of course, it is not excluded that there are delayed messages at the week level, month level and year level in some scenarios. Taking the delayed messages including the second level, minute level, hour level and day level as an example, the module delay level of the delay processing module 121 may include:
[0060] (1) Second level: The delay processing module 121 of this level can be used to process delayed messages with a delay time of 1 to 59 seconds;
[0061] (2) Minute level: The delay processing module 121 of this level can be used to process delayed messages with a delay time of 1 to 59 minutes;
[0062] (3) Hour level: The delay processing module 121 of this level can be used to process delayed messages with a delay time of 1 to 23 hours;
[0063] (4) Day level: The delay processing module 121 of this level can be used to process delayed messages with a delay time of 1 to 6 days.
[0064] Taking a certain delay processing process of a certain delay message by the above-mentioned delay message processing system 100 as an example, the determination process of the target delay processing module is introduced:
[0065] The time when the delayed message cluster 120 first receives the delayed message is 8:00, and the message expiration time of the delayed message is 9:02:30. In the first round of processing of the delayed message, the determination step of the target delay processing module may include:
[0066] S1.1. Determine the message delay time of the delayed message based on the current time and the delayed message expiration time of the delayed message:
[0067] Message delay time = message expiration time - current time
[0068] After calculation, the message delay time of the above delayed message is 1 hour, 2 minutes and 30 seconds;
[0069] S1.2, determining a message delay level of the delayed message based on the message delay time;
[0070] The message delay level may be the maximum time unit of the message delay time. For example, the message delay time of 1 hour, 2 minutes and 30 seconds mentioned above, the maximum time unit of the message delay time is hour, and the corresponding message delay level is hour level;
[0071] S1.3, determining a delay processing module 121 whose module delay level is not greater than the above message delay level in the delay processing module corresponding to the delayed message cluster 120;
[0072] The message delay level determined in the above steps is hourly, and the delayed message cluster 120 is provided with delay processing modules 121 of four levels: second level, minute level, hour level and day level. The delay processing module 121 not greater than the hour level includes delay processing modules of three levels: second level, minute level and hour level.
[0073] S1.4, determining a target delay processing module in the delay processing module 121 whose module delay level is not greater than the above message delay level;
[0074] The target delay processing module is the delay processing module 121 with the maximum module delay level among the delay processing modules 121 whose module delay level is not greater than the above-mentioned message delay level. That is, in this round of processing, the target delay processing module of the above-mentioned delayed message is the hourly-level delay processing module 121 in the delayed message processing cluster 120.
[0075] After determining the target delay processing module, the delay message cluster 120 uses the target delay processing module to perform delay processing on the delay message. It is understandable that the delay processing module 121 can implement delay processing of the delay module through a polling mechanism, a time-driven mechanism, and a callback mechanism, for example, a polling mechanism: regularly querying whether the delay message reaches the current delay duration, and a time-driven mechanism and a callback mechanism: triggering a corresponding event or callback function to process the delay message when the delay message expires.
[0076] The specific method of implementing delay processing by the delay processing module 121 is introduced below:
[0077] As an optional implementation of the above-mentioned delayed message processing system, the above-mentioned delay processing module 121 includes:
[0078] A target index group determination unit, configured to determine, among the index groups corresponding to the target delay processing modules and whose index delay times are not greater than the message delay times, an index group having a maximum index delay time as a target index group;
[0079] The index unit construction unit is used to construct an index unit for the delayed message based on the index expiration time of the delayed message and the displacement of the original message, and add the index unit to the target index group. The index expiration time is determined based on the current time and the index delay time corresponding to the target index group.
[0080] It can be understood that the delay processing module 121 is provided with a target index group determination unit and an index unit construction unit. When the delay processing module 121 is determined as a target delay processing module, the above-mentioned target index group determination unit is triggered, thereby determining the target index group in the index group corresponding to the target delay processing module.
[0081] The following is an introduction to the composition of index groups and index units:
[0082] See also Figure 2 , a plurality of different index groups are set in the delay processing modules 121 of different module delay levels, for example:
[0083] (1) In the second-level delay processing module 121, 59 index groups of 1 to 59 seconds can be set;
[0084] (2) The minute-level delay processing module 121 may be configured with 59 index groups ranging from 1 to 59 minutes;
[0085] (3) The hour-level delay processing module 121 can set 23 index groups from 1 to 23 hours;
[0086] (4) The day-level delay processing module 121 can set 7 index groups of 1 to 7 days.
[0087] Each index group corresponds to an index delay time. Taking the 1-day index group in the day-level index group as an example, the index delay time corresponding to this index group is 1 day. Each index group includes one or more index units, and each index unit stores the original message displacement of the delayed message and the index expiration time of the delayed message. It can be understood that the delayed message received by the delay scheduler 110 may not be the delayed message body, but may be the delayed message topic, which stores information such as the message expiration time and the original message displacement of the delayed message, and the original message displacement is used to locate the delayed message. The index expiration time in the index unit is determined based on the current time and the index delay time corresponding to the target index group.
[0088] See also Figure 3 Taking the above delay processing process of a certain delayed message as an example, the working steps of the above target index group determination unit and the index unit construction unit are introduced:
[0089] Step S2.1: Determine an index group whose index delay time is not greater than the message delay time in the target delay processing module determined in step S1.4;
[0090] The above step S1.1 calculates that the message delay time of the above delayed message is 1 hour, 2 minutes and 30 seconds. In the target delay processing module with the module delay level of the hour level, the index groups with index delay time not greater than the message delay time include: 1 hour index group;
[0091] Step S2.2: determining the index group with the largest index delay time among the index groups whose index delay time is not greater than the message delay time as the target index group;
[0092] That is, set the 1-hour index group as the target index group, and the index delay time corresponding to this index group is 1 hour;
[0093] Step S2.3: Calculate the index expiration time of the delayed message;
[0094] The index expiration time is calculated based on the current time and the index delay time of the target index group determined in step S2.2:
[0095] Index expiration time = current time + index delay time
[0096] For example, if the current time is 8:00, the index expiration time of the delayed message is 9:00;
[0097] Step S2.4: construct an index unit;
[0098] The index unit includes the original message displacement of the delayed message and the index expiration time;
[0099] Step S2.5: Add the index unit to the target index group.
[0100] It is understandable that after adding the index unit of the current delayed message to the target index group, the delayed message can be monitored by monitoring the index group to see whether it reaches the index expiration time, and the delayed message can be re-delivered to the delay scheduler 110 when the index expiration time is reached.
[0101] In addition, it can be understood that, since each index group corresponds to a certain index delay time, the index expiration time of each index unit within the index group increases, that is, the index unit can achieve first-in-first-out.
[0102] In the above scheme, the delay processing module uses the index group to locate and delay the delayed message, so that the above-mentioned delayed message processing system 100 can quickly and accurately find and process the corresponding delayed message according to the index expiration time. On the one hand, it is beneficial to improve the delayed message delivery accuracy of the above-mentioned delayed message processing system 100; on the other hand, the index expiration time of the index units in each index group is arranged in ascending order, following the first-in-first-out principle, thereby realizing the sequential consumption of delayed messages. The above-mentioned delayed message processing system 100 can quickly confirm which delayed messages have reached the index expiration time, which is beneficial to improve the delay processing pressure of the delayed message processing system 100.
[0103] The following is an introduction to the scheme of the delayed message processing system 100 for determining whether the delayed message reaches the index expiration time:
[0104] As an optional implementation of the above-mentioned delayed message processing system, the above-mentioned delayed message cluster 120 also includes:
[0105] The expiration scanning module is used to use the scanning thread to scan the index expiration time of the index unit in the index group, and judge whether the delay message corresponding to the index unit is expired based on the current time and the index expiration time, and return the delay message to the delay scheduler when the index expiration time expires.
[0106] It can be understood that the index groups in the delay processing module 121 can be stored centrally in the memory, or stored in multiple partitions of the memory. The partitions can be divided according to the module delay level of the delay processing module 121. For example, the index groups corresponding to the above-mentioned second-level, minute-level, hour-level and day-level delay processing modules 121 are respectively stored in four partitions of the memory.
[0107] The expiration scanning module can create an appropriate number of scanning threads according to the system load and performance requirements of the delayed message system 100. Each scanning thread can be awakened periodically and perform scanning operations. For example, the scanning thread wakes up once per second and performs scanning operations. When scanning, the scanning thread can compare the current time with the index expiration time in the index unit to determine whether the delayed message has reached the index expiration time. When the delayed message reaches the index expiration time, the delayed message is returned to the delay scheduler 110 through the delayed message return module 122.
[0108] The above scheme scans the index group by thread scanning to determine whether the delayed message reaches the index expiration time. On the one hand, by thread scanning, the delayed message processing system 100 can quickly locate the delayed message that reaches the index expiration time. On the one hand, it is beneficial to improve the query efficiency of the delayed message processing system 100 when querying the delayed message that reaches the index expiration time; on the other hand, since the index units in the index group are arranged in order according to the index expiration time, only one or more index units at the front position in the index group can be scanned during thread scanning, which is beneficial to further improve the query efficiency; on the other hand, by combining thread scanning with index groups, it is beneficial to reduce the IO overhead of the above delayed message processing system.
[0109] See also Figure 4 The following takes the process of the delayed message processing system 100 processing a delayed message as an example to introduce the working principle of the delayed message processing system 100:
[0110] Assuming that the current time is 8:00:00, and the expiration time of the delayed message generated by the message producer is 9:02:30, the processing steps of the delayed message processing system 100 for the delayed message include:
[0111] Step S3.1: the delay scheduler 110 receives the delay message generated by the message producer;
[0112] Step S3.2: after receiving the delay message, the delay scheduler 110 determines whether the delay message has expired according to the current time and the message expiration time of the delay message, and sends the delay message to the delay message cluster 120 if the delay message has not expired;
[0113] The expiration time of the above delayed message is 9:02:30. If the current time has not reached the expiration time, it proves that the delayed message has not expired.
[0114] Step S3.3: The delayed message cluster 120 receives the delayed message sent by the delayed scheduler 110, and determines the message delay time of the delayed message based on the current time and the message expiration time of the delayed message. The calculation method may be:
[0115] Message delay time = message expiration time - current time
[0116] After calculation, the message delay time of the delayed message is: 1:02:30, which is 1 hour, 2 minutes and 30 seconds;
[0117] Step S3.4: Determine the target delay processing module;
[0118] It can be understood that the message delay level can be the maximum time unit of the message delay time. Taking the above message delay time of 1 hour, 2 minutes and 30 seconds as an example, the maximum time unit of the message delay time is hour, and the corresponding message delay level is hour level;
[0119] Assuming that the current delayed message cluster 120 is provided with delay processing modules of four levels, namely, second level, minute level, hour level and day level, then the target delay processing module is the delay processing module 121 whose module delay level is not greater than the message delay level (hour level) (including delay processing modules 121 of three levels, namely, second level, minute level and hour level), and the delay processing module 121 having the maximum module delay level (the highest level among the three levels, namely, hour level), namely, the target delay processing module corresponding to the above-mentioned delayed message is the delay processing module 121 of the delayed message cluster 120 whose module delay level is hour level;
[0120] Step S3.5: determining a target index group in the index group corresponding to the target delay processing module, constructing an index unit and adding it to the target index group;
[0121] In this delay processing, the target index group determined is the 1-hour index group;
[0122] Step S3.6: After the target delay processing module completes the delay processing of the delay message, the delay message cluster 120 uses the delay message return module 122 to return the delay message to the delay scheduler 110;
[0123] Step S3.7: the delay scheduler 110 receives the delay message returned by the delay message cluster 120, re-determines whether the delay message has expired according to the current time and the message expiration time of the delay message, and sends the delay message to the delay message cluster 120 if the delay message has not expired;
[0124] When the delayed message returns to the delay scheduler 110, the delayed message has been delayed for 1 hour. The current time is 9:00:00, and the message expiration time is still 9:02:30. After judgment, the delayed message has not expired. Therefore, the delayed message is re-delivered to the delayed message cluster;
[0125] Step S3.8: the delayed message cluster 120 re-determines the target delay processing module based on the message delay time (2 minutes and 30 seconds);
[0126] The delayed message cluster 120 uses the delay processing module 121 with a module delay level of minute level in the delayed message cluster 120 as a target delay processing module to perform delay processing on the delayed message;
[0127] Step S3.9: determining a target index group in the index group corresponding to the target delay processing module, constructing an index unit and adding it to the target index group;
[0128] In this delay processing, the target index group determined is the 2-minute index group;
[0129] Step S3.10: After the target delay processing module completes delay processing on the delay message, the delay message cluster 120 uses the delay message return module 122 to return the delay message to the delay scheduler 110;
[0130] Step 3.11: The delay scheduler 110 receives the delay message returned by the delay message cluster 120, re-determines whether the delay message has expired based on the current time and the message expiration time of the delay message, and sends the delay message to the delay message cluster 120 if the delay message has not expired;
[0131] When the delayed message returns to the delay scheduler 110, the delayed message is delayed for another 2 minutes. At this time, the current time is 9:02:00, and the message expiration time is still 9:02:30. After judgment, the delayed message is still not expired, so the delayed message is re-delivered to the delayed message cluster;
[0132] Step S3.12: the delayed message cluster 120 re-determines the target delay processing module;
[0133] The delayed message cluster 120 uses the delay processing module 121 with a module delay level of seconds in the delayed message cluster 120 as a target delay processing module to perform delay processing on the delayed message;
[0134] Step S3.13: determining a target index group in the index group corresponding to the target delay processing module, constructing an index unit and adding it to the target index group;
[0135] In this delay processing, the target index group determined is the 2-minute index group;
[0136] Step S3.14: After the target delay processing module completes delay processing on the delay message, the delay message cluster 120 uses the delay message return module 122 to return the delay message to the delay scheduler 110;
[0137] Step S3.15: the delay scheduler 110 receives the delay message returned by the delay message cluster 120, re-determines whether the delay message has expired according to the current time and the message expiration time of the delay message, and sends the delay message to the delay message cluster 120 if the delay message has not expired;
[0138] When the delayed message returns to the delay scheduler 110, the delayed message is delayed for another 30 seconds. The current time is 9:02:30 and the message expiration time is still 9:02:30. After judgment, the delayed message has expired, so the delayed message is delivered to the delayed message consumer.
[0139] The horizontal expansion solution of the delayed message cluster 120 is introduced below:
[0140] As an optional implementation of the above-mentioned delayed message processing system, the above-mentioned delayed message cluster 120 includes:
[0141] Multi-level delayed message sub-clusters, the multi-level delayed message sub-clusters are used to delay the delayed messages with different cluster delay level requirements, and return the delayed messages after delay processing to the delay scheduler; wherein the cluster delay level includes at least one of the second level, minute level, hour level and day level.
[0142] It can be understood that the cluster delay level of the delayed message can be the maximum time unit level of the message extension time of the delayed message. For example, if the message extension time of a delayed message is 1 hour, 2 minutes and 30 seconds, then the cluster delay level of the delayed message is at the hour level.
[0143] It can be understood that the cluster delay level of the above-mentioned delayed message sub-clusters can be time requirements such as seconds, minutes, hours and days, or the maximum delay time that the delayed message sub-cluster can handle can be used as the delay level requirement. For example, the delayed message cluster 120 includes four levels of delayed message sub-clusters, wherein the first level of delayed message sub-clusters is used to process delayed messages with a delay message time between (0, T1], the second level of delayed message sub-clusters is used to process delayed messages with a delay message time between (T1, T2], the third level of delayed message sub-clusters is used to process delayed messages with a delay message time between (T2, T3], and the fourth level of delayed message sub-clusters is used to process delayed messages with a delay message time between (T3, T4]. The values of T1, T2, T3 and T4 can be customized according to business needs and the delay processing capabilities and performance of each delayed message sub-cluster.
[0144] In addition, it can be understood that the type of delay processing module and the type of index group contained in each delayed message subcluster can be determined according to the level of the delayed message subcluster. For example, a delayed message subcluster is specifically used to process second-level message delay times. The subcluster can include a second-level delay processing module, and the second-level delay processing module can include 59 index groups from 1 to 59 seconds.
[0145] For example, the delayed message cluster 120 includes four levels of delayed message clusters. Figure 5 The delayed message cluster 120 includes the above-mentioned first-level delayed message sub-cluster, second-level delayed message sub-cluster, third-level delayed message sub-cluster and fourth-level delayed message sub-cluster. After determining the cluster delay level of the delayed message, the delayed scheduler 110 delivers the delayed message to the corresponding delayed message sub-cluster. After delay processing the delayed message, the delayed message sub-cluster returns the delayed message to the delay scheduler 110.
[0146] In the above scheme, by setting up a multi-level delayed message sub-cluster to respectively perform delay processing on delayed messages with different cluster delay level requirements, on the one hand, it is beneficial to improve the delayed message processing capability of the above-mentioned delayed message processing system 100 and realize the expansion of the system's delayed message processing capability; on the other hand, the multi-level delayed message sub-cluster can share the load, which is beneficial to improving the cluster load pressure, thereby improving the stability and reliability of the above-mentioned delayed message processing system.
[0147] It is understandable that the delayed message sub-cluster may have deviations in the delay time of each delayed message processing process. For example, the message delay time of a delayed message is 1 hour, 2 minutes and 30 seconds. Assuming that in the first round of hourly delay processing, due to cluster load pressure, cluster failure and other reasons, the delayed message is retrieved later than the index expiration time of the delayed message in this round of delay processing. When the delayed message is actually retrieved, it has been delayed for 1 hour and 2 minutes. If the difference between the message delay time and the index delay time is used to calculate the message delay time of the next round of delayed processing, the calculated message delay time of the next round of delayed processing is 2 minutes and 30 seconds. The target delay module of the next round of delayed processing determined directly by the message delay time of 2 minutes and 30 seconds is the minute-level delay processing module, and the target index group is the 2-minute index group. In fact, the delayed message has been delayed for 1 hour and 2 minutes. At this time, the next round of message delay time is 30 seconds. The actual target delay processing module should be the second-level delay processing module, and the target index group should be the 30-second index group. If the minute-level delay processing module is used to process the delayed message, the delivery accuracy of the delayed message will be affected. Based on this, the present application provides the following solutions:
[0148] As an optional implementation of the above-mentioned delayed message processing system, the above-mentioned delay scheduler 110 includes:
[0149] The first allocation module is configured to determine a message delay time based on a current time and a message expiration time of the delayed message, determine the cluster delay level of the delayed message based on the message delay time of the delayed message, and deliver the delayed message to a corresponding delayed message sub-cluster.
[0150] In the above scheme, in each allocation process of delayed messages, the first allocation module redetermines the message delay time based on the current time and the message expiration time, and then allocates the delayed messages based on the redetermined message delay time. That is, in each allocation process of delayed messages, the message delay time is corrected based on the current time and the message expiration time, thereby improving the accuracy of delayed message delivery at each allocation, and further improving the accuracy of delayed message delivery by the above delayed message processing system 100.
[0151] Another expansion solution of the delayed message cluster 120 is introduced below:
[0152] See also Figure 6 As an optional implementation of the above-mentioned delayed message processing system, the above-mentioned delayed message cluster 120 includes:
[0153] A plurality of delayed message subclusters 120 - 1 ′, 120 - 2 ′, . . . , 120 - n ′, each delayed message subcluster is configured with a load balancing weight, and the load balancing weight is used to indicate the probability of a delayed message being delivered to the delayed message subcluster;
[0154] The delay scheduler 110 includes:
[0155] The second allocation module 111 is configured to deliver the delayed message based on the load balancing weight.
[0156] It can be understood that the above-mentioned load balancing weight can be determined based on a load balancing algorithm. The load balancing algorithm can adopt a mature algorithm in the relevant technology, for example: a load balancing algorithm that dynamically calculates the cluster load weight based on cluster performance and load pressure, etc. For relevant content about the load balancing algorithm, please refer to the relevant technology, and the embodiments of this application will not be repeated.
[0157] In the above scheme, in each delivery process of the delayed message, the second allocation module 111 in the delay scheduler 110 delivers the delayed message based on the load balancing weight. The load balancing weight is used to indicate the probability of the delayed message being delivered to the delayed message sub-cluster. On the one hand, the delayed message allocation scheme based on the load balancing weight enables the delay scheduler to reasonably allocate the delayed messages, which is beneficial to reduce the probability of cluster overload, thereby helping to improve the overall processing capacity of the above-mentioned delayed message processing system 100; on the other hand, the load balancing allocation scheme is beneficial to improve the overall resource utilization of the delayed message cluster 120.
[0158] See also Figure 7 In practical applications, in order to meet business needs, the delayed message processing system 100 may further include:
[0159] The business message cluster 130 is provided with a message topic, which is used to receive the delayed message generated by the delayed message producer, switch the delayed message to the delayed message topic, and then send the delayed message topic to the delay scheduler 110 .
[0160] At this time, the delay message received by the delay scheduler 110 is the delay message topic sent by the above-mentioned business message cluster 130.
[0161] In addition, it can be understood that the above delayed message topic contains relevant information about the delayed message, such as the original message displacement of the delayed message, the message expiration time, the delayed message producer of the delayed message, etc. The delayed messages of different topics are isolated from each other, which is conducive to quickly locating the delayed message.
[0162] In addition, in order to cope with different business message clusters, a delay channel may be set in the delay message cluster 120, and each delay channel may correspond to one or more business message clusters 130. It is understandable that Figure 7 The illustrated scheme only shows a scheme in which one delay channel corresponds to one service message cluster 130, that is, delay channel 1 corresponds to service message cluster 1, and delay channel 2 corresponds to service message cluster 2. When there are multiple service message clusters corresponding to the delay channel, the delay scheduler 110 can determine the source of the delay message according to the service message cluster information contained in the delay message topic sent by the service message cluster 130, so as to facilitate accurate delivery of the delay message.
[0163] It can be understood that the delay channel is a logical channel in the delay message cluster 120 for implementing the delay processing function, and the delay channel may include the delay processing module 121, the delay message return module 122, the expiration scanning module and other modules.
[0164] When the service message cluster 130 is included, the overall process of the delayed message processing system 100 processing a delayed message may include:
[0165] Step S4.1: the service message cluster 130 receives a delayed message generated by a delayed message producer;
[0166] Step S4.2: the message topic in the business message cluster 130 switches the received delayed message to the delayed message topic;
[0167] Step S4.3: The delay scheduler 110 consumes the delay message of the delay message topic and sends the delay message to the corresponding delay channel in the delay message cluster 120;
[0168] Step S4.4: the delayed message cluster 120 uses the delayed channel to perform delayed processing on the delayed message, and returns the delayed message to the delay scheduler 110 after the current delay expires;
[0169] Step S4.5: The delay scheduler 110 determines whether the delayed message has reached the message expiration time. If not, it is re-delivered to the delayed message cluster 120. If it is expired, it is delivered to the message topic in the original business message cluster 130.
[0170] Step S4.6: The message topic of the business message cluster 130 receives the expired delayed message, and then delivers the delayed message to the delayed message consumer, so that the delayed consumer consumes the delayed message.
[0171] See also Figure 8 Based on the same inventive concept, the embodiment of the present application also provides a delayed message processing method applied to the delayed message cluster 120, the method comprising:
[0172] Step S210: receiving a delay message sent by the delay scheduler 110;
[0173] Step S220: Determine the message delay time of the delayed message based on the current time and the message expiration time of the delayed message;
[0174] Step S230: determining a message delay level of the delayed message based on the message delay time;
[0175] Step S240: among the delay processing modules 121 corresponding to the current delayed message cluster and whose module delay level is not greater than the message delay level, determine the delay processing module with the largest module delay level as the target delay processing module;
[0176] Step S250: using the target delay processing module to perform delay processing on the delay message;
[0177] Step S260: using the delay message returning module 122 to return the delay message after delay processing to the delay scheduler 110.
[0178] It is understandable that, in addition to the above steps S210 to S260, the above delayed message processing method applied to the delayed message cluster 120 may also execute any algorithm step implemented by the delayed message cluster 120 in the above description of the delayed message processing system 100 .
[0179] See also Fig. 9 Based on the same inventive concept, the embodiment of the present application further provides a delay message processing method applied to the delay scheduler 110, the method comprising:
[0180] Step S310: receiving a delay message sent by a delay message producer;
[0181] Step S320: judging whether the delayed message has expired according to the current time and the message expiration time of the delayed message;
[0182] Step S330: When the delayed message has not expired, the delayed message is delivered to the delayed message cluster, so that the delayed message cluster performs delay processing on the delayed message and re-delivers the delayed message after delay processing to the delay scheduler;
[0183] Step S340: after receiving the delayed message returned by the delayed message cluster, re-determine whether the delayed message has expired, and re-execute the delayed message delivery step if the delayed message has not expired, until the delayed message expires.
[0184] It is understandable that, in addition to the above steps S310 to S340, the above delayed message processing method applied to the delayed message cluster 120 can also execute any algorithm step implemented by the delay scheduler 110 in the above description of the delayed message processing system 100.
[0185] Fig.10 A schematic diagram of an electronic device provided in an embodiment of the present application. Fig.10 The electronic device 400 includes: a processor 410, a memory 420 and a communication interface 430. These components are interconnected and communicate with each other through a communication bus 440 and / or other forms of connection mechanisms (not shown).
[0186] The memory 420 includes one or more (only one is shown in the figure), which may be, but not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. The processor 410 and other possible components may access the memory 420, and read and / or write data therein.
[0187] The processor 410 includes one or more (only one is shown in the figure), which can be an integrated circuit chip with signal processing capabilities. The above-mentioned processor 410 can be a general-purpose processor, including a central processing unit (CPU), a micro control unit (MCU), a network processor (NP) or other conventional processors; it can also be a special-purpose processor, including a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0188] The communication interface 430 includes one or more (only one is shown in the figure), which can be used to communicate directly or indirectly with other devices to exchange data. For example, the communication interface 430 can be an Ethernet interface; it can be a mobile communication network interface, such as an interface of a 3G, 4G, or 5G network; or it can be other types of interfaces with data transceiving functions.
[0189] One or more computer program instructions may be stored in the memory 420, and the processor 410 may read and execute these computer program instructions to implement the delayed message processing method applied to the delayed scheduler 110 and the delayed message processing method applied to the delayed message cluster 120 provided in the embodiments of the present application, as well as other desired functions.
[0190] Understandably, Fig.10 The structure shown is for illustration only. The electronic device 400 may also include Fig.10 More or fewer components as shown, or with Fig.10 Different configurations are shown. Fig.10 Each component shown in the figure can be implemented by hardware, software or a combination thereof. For example, the electronic device 400 can be a single server (or other device with computing processing capabilities), a combination of multiple servers, a cluster of a large number of servers, etc., and can be both a physical device and a virtual device.
[0191] The present application also provides a computer-readable storage medium, which stores computer program instructions. When the computer program instructions are read and executed by a computer processor, the delayed message processing method applied to the delayed scheduler 110 and the delayed message processing method applied to the delayed message cluster 120 provided in the present application are executed. For example, the computer-readable storage medium can be implemented as Fig.10 The memory 420 in the electronic device 400.
[0192] In the embodiments provided in the present application, it should be understood that the disclosed systems and methods can be implemented in other ways. The system embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some communication interface, system or unit, which can be electrical, mechanical or other forms.
[0193] In addition, the modules described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0194] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0195] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A delayed message processing system, characterized in that: The system comprises: a delay scheduler and a delay message cluster communicating with the delay scheduler, wherein: The delay scheduler is used to receive the delay message sent by the delay message producer and the delay message cluster, and judge whether the delay message has expired according to the current time and the message expiration time of the delay message, and when the delay message has not expired, deliver the delay message to the delay message cluster; The delayed message cluster includes a multi-level delay processing module and a delayed message return module. The multi-level delay processing modules respectively perform delay processing on the delayed messages with different message delay level requirements. After the target delay processing module completes the delay processing of the delayed message, the delayed message return module returns the delayed message to the delay scheduler. Among them, the target delay processing module is the delay processing module with the maximum module delay level among the delay processing modules whose module delay level is not greater than the message delay level in the current delayed message cluster; the message delay level is determined based on the message delay time of the delayed message; and the message delay time is determined based on the current time and the message expiration time.
2. The delayed message processing system according to claim 1, characterized in that: The delay processing module comprises: a target index group determining unit, configured to determine, among the index groups corresponding to the target delay processing module and whose index delay time is not greater than the message delay time, the index group having the largest index delay time as the target index group; An index unit construction unit is used to construct an index unit for the delayed message based on the index expiration time of the delayed message and the original message displacement, and add the index unit to the target index group; wherein the index expiration time is determined based on the current time and the index delay time corresponding to the target index group.
3. The delayed message processing system according to claim 2, characterized in that: The delayed message cluster also includes: An expiration scanning module is used to use a scanning thread to scan the index expiration time of the index unit in the index group, and determine whether the delay message corresponding to the index unit has expired based on the current time and the index expiration time, and return the delay message to the delay scheduler when the index expiration time expires.
4. The delayed message processing system according to claim 1, characterized in that: The delayed message cluster includes: A multi-level delayed message sub-cluster, wherein the multi-level delayed message sub-clusters are respectively used to perform delay processing on the delayed messages with different cluster delay level requirements, and return the delayed messages after delay processing to the delay scheduler; wherein the cluster delay level includes at least one of seconds, minutes, hours and days.
5. The delayed message processing system according to claim 4, characterized in that: The delay scheduler comprises: A first allocation module is configured to determine the message delay time based on the current time and the message expiration time of the delayed message, determine the cluster delay level of the delayed message based on the message delay time, and deliver the delayed message to the corresponding delayed message sub-cluster.
6. The delayed message processing system according to claim 1, characterized in that: The delayed message cluster includes: a plurality of delayed message sub-clusters; wherein each of the delayed message sub-clusters is configured with a load balancing weight, and the load balancing weight is used to indicate the probability that the delayed message is delivered to the delayed message sub-cluster; The delay scheduler comprises: A second allocation module is used to deliver the delayed message based on the load balancing weight.
7. A delayed message processing method, characterized in that: Applied to delayed message clusters, the method comprises: Receive delay messages sent by the delay scheduler; determining a message delay time of the delayed message based on a current time and a message expiration time of the delayed message; determining a message delay level of the delayed message based on the message delay time; Among the delay processing modules corresponding to the current delayed message cluster and whose module delay level is not greater than the message delay level, determining the delay processing module with the largest module delay level as the target delay processing module; Using the target delay processing module to perform delay processing on the delay message; The delayed message after delay processing is returned to the delay scheduler by using a delayed message return module.
8. A delayed message processing method, characterized in that: Applied to a delay scheduler, the method comprises: Receive delayed messages sent by delayed message producers; Determine whether the delayed message has expired according to the current time and the message expiration time of the delayed message; When the delayed message has not expired, delivering the delayed message to a delayed message cluster, so that the delayed message cluster performs delay processing on the delayed message and re-delivers the delayed message after delay processing to the delay scheduler; After receiving the delayed message returned by the delayed message cluster, it is re-determined whether the delayed message has expired, and if the delayed message has not expired, the delayed message delivery step is re-executed until the delayed message expires.
9. An electronic device, characterized in that: include: A processor, a memory and a communication bus, wherein the processor and the memory communicate with each other via the communication bus; The memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the method according to claim 7 or 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, which, when executed by a computer, cause the computer to perform the method according to claim 7 or 8.
Citation Information
Patent Citations
Delay message processing method and equipment
CN112787958A
Message processing method, device and equipment
CN113064707A
Delay message processing system, method and equipment and storage medium
CN113568976A
Message processing method and device, medium and computing equipment
CN117785514A
Kafka accurate delay control method and device, computer equipment and storage medium
CN118590448A