Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Method and system for realizing delay message queue

A message queue and message technology, applied in the field of distributed services, can solve problems affecting the overall performance of the service, message queues do not support delayed messages, database read and write performance degradation, etc., to solve system performance degradation, zero intrusion, and avoid risks Effect

Active Publication Date: 2020-06-02
西藏宁算科技集团有限公司
View PDF4 Cites 13 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] The existing system polls the database by setting a timer to achieve delayed messages, which causes a sharp decline in the read and write performance of the database, thus affecting the overall performance of the service
Message queues already exist in many existing distributed systems. Some message queues do not support delayed messages, and some partially support delayed messages (for example, there are restrictions on the delay time, such as 5 minutes, 10 minutes, 1 Hours, etc., does not support delayed messages at any time), cannot fully meet business needs

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and system for realizing delay message queue
  • Method and system for realizing delay message queue
  • Method and system for realizing delay message queue

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0028] The message queue is an important component in a distributed system. The message queue improves system performance and peak load reduction through asynchronous processing, and reduces system coupling. When the message queue server is not used, the user's request data is directly written into the database. Under certain circumstances, the pressure on the database increases, making the response speed slower. After using the message queue, the user's request data is sent to the message queue and returned immediately, and then the consumer process of the message queue obtains the data from the message queue and writes it into the database asynchronously.

[0029] The existing conventional method is to poll the database by setting a timer to realize the delayed message, which causes a sharp decline in the read and write performance of the database, thereby affecting the overall performance of the service; and the method of the present invention uses the server to periodically...

Embodiment 2

[0058] refer to Figure 4 , is the second embodiment of the present invention, and this embodiment is different from the first embodiment in that it provides a system based on implementing a delayed message queue, including a client module 100, a server module 200, and a relational database 300. In-memory database 400, client module 100, including dispatcher 101, which corresponds to server module 200 and cooperates with each other, dispatcher 101 calls the message pull interface, and writes the message subject and message expiration time, through Feedback from the server module 200 to obtain delayed message records; the server module 200 includes a processing center 201, the processing center 201 receives the message to be written, and transmits it to the relational database 300, and the processing center 201 is based on the expiry time of the message Determine the time that is greater than the current server module 200 to generate a delayed message record, and use the period...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method and system for realizing a delay message queue, and the method comprises the steps that a client module transmits a message to a server module, and the server module writes the message into a relational database for storage; the server module judges that the expiration time of the message is greater than the time of the current server, and generates a delay messagerecord; the server module writes the delay message record into a delay message queue in a memory database, and periodically polls the delay message queue; the client module pulls a delay message record to the server module, and the server module checks the delay message queue, reads the message content in the relational database and feeds back the message content to the client module; and the client module receives the message content, sends ACK to the server module, and displays that the message is successfully received. According to the method, an extension strategy is adopted, various service scenes needing message delay are supported, functions of an existing message queue system are fully utilized to achieve zero invasion, and risks caused by modification of an original message queuesystem are avoided.

Description

technical field [0001] The present invention relates to the technical field of distributed services, in particular to a method and system for implementing delayed message queues. Background technique [0002] The message queue has a good peak-shaving function—that is, through asynchronous processing, transaction messages generated in a short period of high concurrency are stored in the message queue, thereby smoothing out concurrent transactions during the peak period. In some flash sales and promotional activities of e-commerce, reasonable use of message queues can effectively resist the impact of a large number of orders on the system at the beginning of promotional activities. A delayed message means that the message is not immediately visible to the consumer after it is sent, but is delivered to the consumer at the time specified by the user. For example, if we now send a message with a delay of 1 minute, it will be sent to the server immediately after the message is se...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): H04L29/08G06F9/54
CPCH04L67/10H04L67/1097G06F9/546G06F2209/548H04L67/51H04L67/568
Inventor 白天
Owner 西藏宁算科技集团有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products