Message queue consumption speed control method and device, electronic equipment and medium
A message queue and speed control technology, applied in the computer field, can solve the problem of high algorithm complexity, achieve the effect of controlling the number of consumption threads and reducing the implementation complexity
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0023] figure 1 It is a flow chart of the method for controlling the consumption speed of the message queue provided by Embodiment 1 of the present invention. This embodiment is applicable to the situation of controlling the consumption speed of the message queue. The method can be executed by a message queue consumption speed control device, which can be implemented in software and / or hardware, and can be configured in an electronic device, which can be an electronic device with communication and computing capabilities such as a server. Such as figure 1 As shown, the method specifically includes:
[0024] S110. Responding to the timed task start request, take out a first number of messages from the message queue; where the first number is the same as the number of fragmented tasks of the timed task.
[0025] Wherein, a scheduled task refers to a task executed based on a given time point, a given time interval, or a given number of executions. Exemplarily, the timing task i...
Embodiment 2
[0043] figure 2 It is a flow chart of the method for controlling the consumption speed of message queues provided by Embodiment 2 of the present invention. This embodiment is further optimized on the basis of the above embodiments. Before taking out the first number of messages from the queue, the method further includes: obtaining an instruction for updating the execution frequency of the scheduled task; and setting the execution frequency of the scheduled task according to the instruction for updating the execution frequency.
[0044] Such as figure 2 As shown, the method includes:
[0045] S210. Obtain an instruction to update the execution frequency of the scheduled task.
[0046] Wherein, the instruction for updating the execution frequency of the scheduled task refers to an instruction for adjusting the execution frequency of the scheduled task. For the timing task that is fragmented for the first time, the timing task execution frequency update instruction is used ...
Embodiment 3
[0054] image 3 It is a schematic structural diagram of a message queue consumption speed control device provided in Embodiment 3 of the present invention. This embodiment is applicable to the situation of controlling the consumption speed of a message queue. The device can be implemented by software and / or hardware, and can be configured in electronic equipment.
[0055] Such as image 3 As shown, the apparatus may include: a message fetching module 310 and a message processing module 320 .
[0056] The message fetching module 310 is configured to fetch a first number of messages from the message queue in response to the timing task start request; wherein, the first number is the same as the number of fragmented tasks of the timing task.
[0057] The message processing module 320 is configured to process the message through the fragment task.
[0058] In the technical solution provided by the embodiment of the present invention, a first number of messages is taken out from...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


