The invention belongs to the technical field of
message processing, and provides a
queue message backlog
processing method,
system and equipment based on a
coroutine technology, which are used for monitoring the backlog amount of message queues in real time and dynamically increasing the number of
coroutine consumers according to the backlog condition of the message queues; dividing the
message queue into a plurality of partitions, and dynamically adjusting partition distribution according to the load condition of each
coroutine consumer; coroutine consumers pre-fetch messages from the
message queue server in batches, the number of the pre-fetched messages is dynamically adjusted according to the current backlog condition and the
processing speed of the consumers, and a local cache
queue is constructed at the
consumer side to store the pre-fetched messages; and coroutine consumers concurrently process a plurality of messages by using a coroutine, and send receipts to the
message queue in combination with an asynchronous
receipt mechanism. According to the method, the problem of message backlog of the message
queue is solved by utilizing a coroutine technology, and
message delay is reduced and the real-time performance and the
resource utilization rate of the
system are improved through optimization means such as
dynamic extension of the coroutine
consumer pool, batch prefetching of messages and concurrent
processing.