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

Method and system for realizing delay queue through multiple strategies

A multi-strategy and queue technology, applied in the field of delay queues, can solve problems such as poor disaster tolerance, bulkiness, and message loss, and achieve the effects of improving system stability, system performance, and avoiding message loss

Pending Publication Date: 2022-05-06
SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF0 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0002] To realize the delay queue, timing tasks, DelayQueue, redis expiration callback, rabbitmq, etc. are generally used, but the existing technology either cannot realize distributed calls, or has poor disaster tolerance, or needs to introduce relatively heavyweight middleware, which is not easy to expand
[0003] The traditional delay queue is generally implemented by rabbitmq, but rabbitmq is relatively heavy. If the current business system uses rabbitmq, it can be considered, but if not, it is more cumbersome to use rabbitmq. Most of the DelayQueue and timing tasks that come with java do not support distributed , and non-persistent, the expiration callback of redis supports distributed but poor disaster tolerance, which may easily lead to message loss

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 queue through multiple strategies

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0043] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.

[0044] A multi-strategy method for implementing delay queues. The implementation of this method is based on the fact that the system has integrated redis and realized the operations of adding, deleting and querying zset of redis. Redis's zset is an ordered set that does not allow duplicate members. By adding elements to zset and setting ordered scores, redis sorts the members in the set from small to large according to the scores, and then sorts them according to the scores Take out, realize first-in first-out.

[0045] Implementations of this method include:

[0046] 1. Message instance

[0047] In this solution, a message includes five parts: message topic, message body, delay time, consumption times and consumption exception handling type:

[0048] topic, message topic, in order to facilitate business splitting, multiple topics can be set...

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 queue through multiple strategies, and belongs to the technical field of delay queues, redis is integrated on the basis of a system, zset adding, deleting and querying operations of the redis are realized, and the method comprises the following steps: a message instance, one message comprising message topic, a message body, delay time, consumption times and consumption exception processing types; generating a message, packaging a message instance according to service requirements, setting top, a message body, delay time, consumption times and consumption exception processing types, and putting the message into zset through a redis tool method; message consumption; and the consumption strategies comprise a consumption method transverse multi-strategy and a consumption method longitudinal multi-strategy. According to the invention, the distributed and lightweight class can be realized, the disaster tolerance is relatively good, and the research and development cost and the maintenance cost can be reduced.

Description

technical field [0001] The invention relates to the technical field of delay queues, in particular to a method and system for implementing delay queues with multiple strategies. Background technique [0002] Delay queues are generally implemented by using scheduled tasks, DelayQueue, redis expiration callback, rabbitmq, etc. However, existing technologies either cannot implement distributed calls, or have poor disaster tolerance, or require heavyweight middleware, which is not easy to expand. [0003] The traditional delay queue is generally implemented by rabbitmq, but rabbitmq is relatively heavy. If the current business system uses rabbitmq, it can be considered, but if not, it is more cumbersome to use rabbitmq. Most of the DelayQueue and timing tasks that come with java do not support distributed , and non-persistent, the expiration callback of redis supports distributed but poor disaster recovery, which may easily lead to message loss. Contents of the invention [0...

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): G06F9/52G06F9/54G06F16/2455G06F16/2458
CPCG06F16/2471G06F16/2455G06F9/546G06F9/522
Inventor 李承林徐士强董玉全
Owner SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
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