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.