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

A rabbitmq-based asynchronous message retry method, system and system construction method

An asynchronous message and construction method technology, applied in transmission systems, electrical components, etc., can solve the problems of reducing the processing capacity of the consumer, waste of resources, etc., and achieve the effect of balancing integrity and system overhead, reliable consumption, and ensuring efficiency

Active Publication Date: 2022-04-19
CHENGDU LUXINGTONG INFORMATION TECH
View PDF7 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

This method mainly has the following two problems: a. If the message cannot be processed at all, it may lead to an infinite loop; b. If the current thread is held, the processing capacity of the Consumer will be greatly reduced. If it is rejected immediately, the queue is empty. The message will be processed immediately after the message is rejected, a very high frequency of retries will lead to a serious waste of resources

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
  • A rabbitmq-based asynchronous message retry method, system and system construction method
  • A rabbitmq-based asynchronous message retry method, system and system construction method
  • A rabbitmq-based asynchronous message retry method, system and system construction method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0043] A method for building a message retry system based on RabbitMQ, comprising the following steps:

[0044] 1. Create an exchange (exchange):

[0045] Work exchange (main exchange): the main exchange, which is published to this exchange when publishing a message, and multiple are created according to business needs.

[0046] retry exchange (retry exchange): retry the exchange, when the message processing is abnormal (within the maximum number of retries), re-deliver the message to the exchange, and create a virtual host (virtual host).

[0047] Fail exchange (failed exchange): Failed exchange, after exceeding the maximum number of retries, the message is delivered to the exchange, in order to maintain business isolation, it is consistent with the work exchange.

[0048] All exchange declarations take the following parameters:

[0049]

[0050] 2. Create a queue:

[0051] work queue: the main queue, which stores published messages. The declaration parameters are as f...

Embodiment 2

[0062] This embodiment discloses a message retry system based on Rabbit tMQ, which is constructed by the construction method of the message retry system based on Rabbit tMQ in the above embodiment.

Embodiment 3

[0064] Such as figure 1 As shown, this embodiment discloses an asynchronous message retry method based on the RabbitMQ-based message retry system of the above-mentioned embodiment, which includes the following steps:

[0065] 1. The producer publishes a message to the work exchange.

[0066] 2. The work exchange distributes the message to the corresponding message queue according to the routing-key.

[0067] 3. Multiple consumers actually consume messages in the main queue at the same time. Therefore, they adopt a "competition" method to strive for news consumption.

[0068] 4. After the message is consumed, regardless of success or failure, the consumer must return an ACK consumption confirmation to the queue to avoid repeated message delivery. At the same time, if the processing is successful, the process ends, otherwise it enters the retry phase.

[0069] 5. Obtain the number of retries x-retry-count from the header (header file) of the message (if the parameter is not ...

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 RabbitMQ-based asynchronous message retry method, system and system construction method. The system construction method includes: steps of configuring exchanges, steps of configuring queues and steps of binding queues to exchanges, through the method. Build the system. The message retry method includes: in the normal message consumption process, the step of retrying the message that fails to be processed for a limited number of times, and the step of manually processing the message that exceeds the number of retries; there is a delay in the retry of the message mechanism, the delay mechanism is based on the expiration time set for the message. The invention can automatically divert and retry the failed messages, avoiding the impact on the process and long-term occupation of the system resources, and the set manual intervention can ensure the reliable consumption of the messages. The invention can set the retry interval of the message and improve the flexibility of the system.

Description

technical field [0001] The invention relates to the field of asynchronous communication, in particular to a method for constructing a message retry system based on RabbitMQ, a message retry system constructed based on the construction method, and an asynchronous message retry method based on the message retry system. Background technique [0002] RabbitMQ is an open source messaging middleware that implements the Advanced Message Queuing Protocol (AMQP). Communication between different processes Process / Thread is carried out by passing messages between the client and RabbitMQ. These clients are divided into two categories: Producer is responsible for sending messages to middleware; and Consumer is responsible for taking messages from middleware and processing them. During message processing, processing tasks fail due to business logic errors, network failures, and other reasons. We expect that when the message consumption is abnormal, the message will be retried automatica...

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 Patents(China)
IPC IPC(8): H04L51/18H04L51/23H04L51/234
CPCH04L51/18H04L51/23H04L51/234
Inventor 宋涛陈剑波
Owner CHENGDU LUXINGTONG INFORMATION TECH
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