CN111124717A - Message delivery method, system and computer storage medium - Google Patents

Message delivery method, system and computer storage medium Download PDF

Info

Publication number
CN111124717A
CN111124717A CN201911378659.XA CN201911378659A CN111124717A CN 111124717 A CN111124717 A CN 111124717A CN 201911378659 A CN201911378659 A CN 201911378659A CN 111124717 A CN111124717 A CN 111124717A
Authority
CN
China
Prior art keywords
message
service
verification
downstream
delayed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911378659.XA
Other languages
Chinese (zh)
Inventor
崔云龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Unicloud Nanjing Digital Technology Co Ltd
Original Assignee
Unicloud Nanjing Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Unicloud Nanjing Digital Technology Co Ltd filed Critical Unicloud Nanjing Digital Technology Co Ltd
Priority to CN201911378659.XA priority Critical patent/CN111124717A/en
Publication of CN111124717A publication Critical patent/CN111124717A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Abstract

A message delivery method and system. Wherein the method comprises: receiving a first message for informing a downstream service of downstream traffic processing and a second message for delayed verification, wherein the second message comprises a time for delayed verification; sending the first message to a downstream service and carrying out corresponding service processing; after the downstream service processing is finished, receiving a confirmation message of the downstream service receiving the first message; the callback service monitors the confirmation message and updates a message library; and performing delay verification according to the delay verification time, and sending a verification result to an upstream service. The scheme of the invention performs secondary confirmation through delayed delivery of the message and performs callback check, thereby realizing the guarantee of reliable delivery of the message.

Description

Message delivery method, system and computer storage medium
Technical Field
The invention belongs to the field of computers, and particularly relates to a message delivery method, a message delivery system and a computer readable storage medium.
Background
With the rise of service-oriented architectures, rabbitmqs are increasingly used in systems. The method can not only provide basic final consistency realization for a service-oriented architecture, but also provide functions of asynchronous processing, traffic peak clipping and the like. Just as rabbitmqs become increasingly important in service-oriented systems, it is more important to ensure that our messages can be sent to the message queue one hundred percent when using rabbitmqs, ensuring that MQ Broker can successfully receive the messages. The RabbitMQ itself provides two service-side acknowledgement mechanisms, Transaction mode and Confirm mode. In addition, a scheme for ensuring the reliable delivery of a production end by adopting a message drop library and marking the message state is also provided.
However, these conventional methods have problems that the transaction mode is blocked, one message is not sent until the next message is sent, and thus the efficiency is low. The database operation is required for many times in the message library falling mode, and better support cannot be provided for some services with high concurrency and high performance requirements.
Disclosure of Invention
In view of the above-mentioned deficiencies of the prior art, it is an object of the present invention to provide a solution for improving the reliability of message delivery.
The embodiment of the invention discloses a message delivery method, which comprises the following steps: receiving a first message for informing a downstream service of downstream traffic processing and a second message for delayed verification, wherein the second message comprises a time for delayed verification; sending the first message to a downstream service and carrying out corresponding service processing; after the downstream service processing is finished, receiving a confirmation message of the downstream service receiving the first message; the callback service monitors the confirmation message and updates a message library; and performing delay verification according to the delay verification time, and sending a verification result to an upstream service.
In a possible embodiment, said performing the delayed verification according to the delayed verification time and sending the verification result to the upstream service includes querying, by the callback service, the message library, and requesting, if the message library is not updated, the upstream service to send the first message again.
In one possible embodiment, the method further includes requesting the upstream service to send the first message again by a Remote Procedure Call (RPC) mode.
The embodiment of the invention discloses a message delivery system, which comprises: a receiving module, configured to receive a first message for notifying a downstream service to perform downstream traffic processing and a second message for delayed validation, where the second message includes a time for delayed validation; the sending module is used for sending the first message to a downstream service and carrying out corresponding service processing; a confirmation module, configured to receive a confirmation message that the downstream service receives the first message after the downstream service completes processing; the callback module is used for monitoring the confirmation message through a callback service and updating a message library; a verification module for performing delayed verification according to the delayed verification time and sending the verification result to the upstream service
The invention also discloses a computer readable storage medium, which stores a computer program, and the computer program realizes the message delivery method when being executed by a processor.
The invention has the beneficial effects that: the scheme of the invention performs secondary confirmation through delayed delivery of the message and performs callback check, thereby realizing the guarantee of reliable delivery of the message.
Drawings
Fig. 1 is a schematic diagram of a network architecture according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a system according to an embodiment of the present invention.
Detailed Description
In order to facilitate understanding of those skilled in the art, the present invention will be further described with reference to the following examples and drawings, which are not intended to limit the present invention.
Referring to fig. 1, which shows a schematic diagram of a network component architecture to which the message delivery method of the present application is applied, as can be seen from fig. 1, the system component architecture may include: a service node 10, at least one upstream served terminal 20 (also referred to as a publishing client), at least one downstream served terminal 30 (also referred to as a subscribing client), and at least one callback served terminal 40.
The service node 10 may be connected to the upstream service terminal 20, the downstream service terminal 30, and the callback service terminal 40 through a network, which may be a wired network, a wireless communication network, or the like.
In an embodiment of the present application, the service node may be a computer device capable of providing a service to the outside. The at least one service node may constitute a publish-subscribe service system. Optionally, in order to improve reliability of the publish-subscribe service and improve security of data, a plurality of service nodes may be deployed in the publish-subscribe service system.
The terminal 20 of the upstream service and the terminal 30 of the downstream service may be mobile terminals such as mobile phones and notebook computers, or may be computer devices such as desktop computers; the intelligent household appliance can also be an intelligent television, an intelligent refrigerator and other intelligent appliances or other intelligent equipment.
The service node 10 allocates a message queue to each subscriber, and then the service node stores the messages in the message queues corresponding to the respective subscribers in the storage addresses. Correspondingly, the terminal that the service node transmits the message to the subscriber may transmit the message in the message queue corresponding to the subscriber to the terminal of the subscriber for the service node. Here the subscriber's terminal may be a terminal 30 of a downstream service or a terminal 40 of a callback service.
The message queue is equivalent to a container for storing messages in the message transmission process.
The service node 10 may be a RabbitMQ server.
The embodiment of the invention discloses a message delivery method, which comprises the following steps:
s101, receiving a first message for informing a downstream service to perform downstream traffic processing and a second message for delaying verification, wherein the second message comprises time for delaying verification.
Specifically, after the service information is put in storage, a message, i.e. the first message Send, is sent to the MQ. This message is used to inform downstream services of downstream traffic processing. After the first message is sent, a Second SendDelay Check message is sent at the same time. This message is used to delay check validation. The time for the delayed verification may be 5 minutes. How much time to delay, depending on the actual traffic.
S102, the first message is sent to downstream service and corresponding business processing is carried out.
Specifically, the downstream service has a consumer for receiving messages sent by the upstream service. And when the consumer receives the message sent by the producer, namely the upstream service, the business processing is carried out.
S103, after the downstream service processing is finished, receiving a confirmation message of the downstream service receiving the first message.
Specifically, after the consumer consumes and finishes the business processing, the consumer sends a confirmation message to the message queue.
S104, the callback service monitors the confirmation message and updates a message library.
Specifically, after the downstream service produces a confirmation message, a consumer consumes the confirmation message in the callback service, and then stores the message information in a database or updates the message state.
And S105, performing delay verification according to the delay verification time, and sending a verification result to an upstream service.
And the step of performing the delay verification according to the delay verification time and sending the verification result to the upstream service comprises the step of inquiring in a message library by the callback service, and requesting the upstream service to send the first message again if the message library is not updated.
For example, the verification is performed after 5 minutes by delaying the verification message from being effective. When the delay check queries the message library in the callback service and finds that no or no expected update is performed on the state, the delay check initiates an RPC ReSend Command request to the upstream service through a Remote Procedure Call (RPC) mode through a main key or other unique identifiers, inquires that the downstream of the message is not processed normally, and requests the upstream service to send the message again.
The scheme not only realizes the reliable delivery of the message, but also can effectively avoid frequent operation on the database, thereby improving the performance; meanwhile, the decoupling between the service database and the message database is realized.
The embodiment of the present invention also discloses a message delivery system 100, as shown in fig. 3, including: a receiving module 101, configured to receive a first message for notifying a downstream service to perform downstream traffic processing and a second message for delayed verification, where the second message includes a time for delayed verification; a sending module 102, configured to send the first message to a downstream service and perform corresponding service processing; a confirmation module 103, configured to receive a confirmation message that the downstream service receives the first message after the downstream service completes processing; the callback module 104 is used for monitoring the confirmation message through a callback service and updating a message library; and the verification module 105 is configured to perform delayed verification according to the delayed verification time, and send a verification result to an upstream service.
For specific implementation of the apparatus 100, reference may be made to the method embodiment, which is not described in detail herein.
In the several embodiments provided in the present application, it should be understood that the disclosed system and method may be implemented in other ways. For example, the above-described embodiments are merely illustrative, and for example, a division of a unit is merely a division of a logic function, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed.
While the invention has been described in terms of its preferred embodiments, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention.

Claims (9)

1. A message delivery method, characterized in that a first message for informing downstream services of downstream traffic processing and a second message for delayed verification are received, wherein the second message comprises a time for delayed verification; sending the first message to a downstream service and carrying out corresponding service processing; after the downstream service processing is finished, receiving a confirmation message of the downstream service receiving the first message; the callback service monitors the confirmation message and updates a message library; and performing delay verification according to the delay verification time, and sending a verification result to an upstream service.
2. The method of claim 1, wherein the performing the delayed verification according to the delayed verification time and sending the verification result to the upstream service comprises the callback service querying a message library and requesting the upstream service to send the first message again if the message library is not updated.
3. The method of claim 2, further comprising requesting an upstream service to resend the first message by Remote Procedure Call (RPC) mode.
4. The method of claim 1, wherein the time for the delayed validation is 5 minutes.
5. A message delivery system, comprising: a receiving module, configured to receive a first message for notifying a downstream service to perform downstream traffic processing and a second message for delayed validation, where the second message includes a time for delayed validation; the sending module is used for sending the first message to a downstream service and carrying out corresponding service processing; a confirmation module, configured to receive a confirmation message that the downstream service receives the first message after the downstream service completes processing; the callback module is used for monitoring the confirmation message through a callback service and updating a message library; and the verification module is used for performing delayed verification according to the delayed verification time and sending a verification result to an upstream service.
6. The system of claim 5, wherein the verification module is further configured to query a message repository for a callback service, and if the message repository is not updated, request the upstream service to resend the first message.
7. The system of claim 6, wherein the verification module is further configured to request an upstream service to resend the first message by way of a Remote Procedure Call (RPC).
8. The system of claim 5, wherein the time for the delayed validation is 5 minutes.
9. A computer storage medium having a computer program stored thereon, which when executed by a processor implements the message delivery method of any of the preceding claims 1-4.
CN201911378659.XA 2019-12-27 2019-12-27 Message delivery method, system and computer storage medium Pending CN111124717A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911378659.XA CN111124717A (en) 2019-12-27 2019-12-27 Message delivery method, system and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911378659.XA CN111124717A (en) 2019-12-27 2019-12-27 Message delivery method, system and computer storage medium

Publications (1)

Publication Number Publication Date
CN111124717A true CN111124717A (en) 2020-05-08

Family

ID=70504208

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911378659.XA Pending CN111124717A (en) 2019-12-27 2019-12-27 Message delivery method, system and computer storage medium

Country Status (1)

Country Link
CN (1) CN111124717A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112698969A (en) * 2020-12-30 2021-04-23 佰年颐堂医疗科技股份有限公司 MQ message reliability delivery solution method based on message drop base
CN113518029A (en) * 2021-05-17 2021-10-19 杭州小鱼互动科技有限公司 Message delivery system with strong functionality
CN115412208A (en) * 2022-08-09 2022-11-29 唯阜德(武汉)科技有限公司 Message transmission method and system for message queue management system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040264488A1 (en) * 2003-06-25 2004-12-30 Hyun-Min Yoon Apparatus and method for processing packets
CN106126353A (en) * 2016-06-17 2016-11-16 乐视控股(北京)有限公司 Control the method and apparatus that application program sends message
CN108153598A (en) * 2017-12-25 2018-06-12 东软集团股份有限公司 Data consistency method and device based on micro services framework
CN109710625A (en) * 2018-12-20 2019-05-03 中科曙光国际信息产业有限公司 The implementation method of distributed consensus based on reliable news

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040264488A1 (en) * 2003-06-25 2004-12-30 Hyun-Min Yoon Apparatus and method for processing packets
CN106126353A (en) * 2016-06-17 2016-11-16 乐视控股(北京)有限公司 Control the method and apparatus that application program sends message
CN108153598A (en) * 2017-12-25 2018-06-12 东软集团股份有限公司 Data consistency method and device based on micro services framework
CN109710625A (en) * 2018-12-20 2019-05-03 中科曙光国际信息产业有限公司 The implementation method of distributed consensus based on reliable news

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112698969A (en) * 2020-12-30 2021-04-23 佰年颐堂医疗科技股份有限公司 MQ message reliability delivery solution method based on message drop base
CN113518029A (en) * 2021-05-17 2021-10-19 杭州小鱼互动科技有限公司 Message delivery system with strong functionality
CN115412208A (en) * 2022-08-09 2022-11-29 唯阜德(武汉)科技有限公司 Message transmission method and system for message queue management system

Similar Documents

Publication Publication Date Title
CN111131501B (en) MQTT protocol-based message pushing system and method
JP4521003B2 (en) Apparatus and associated method for facilitating delivery and processing of push content
CN111124717A (en) Message delivery method, system and computer storage medium
CN110958281B (en) Data transmission method and communication device based on Internet of things
CN102224715A (en) Optimized polling in low resource devices
US11677850B2 (en) Method, apparatus and system for notification
CN111258723B (en) Transaction processing method, device, system, medium and equipment of distributed system
CN112118315A (en) Data processing system, method, device, electronic equipment and storage medium
CN113391979A (en) Processing method, equipment and system for monitoring data display and storage medium
CN112751847A (en) Interface call request processing method and device, electronic equipment and storage medium
CN104320441A (en) Method of sharing information between wireless communication systems
CN111309691A (en) Data sharing exchange system and exchange method based on bus architecture
CN114338063B (en) Message queue system, service processing method and computer readable storage medium
CN101605301A (en) A kind of group system and request message distribution method that carries out the multinode transaction
CN113315689B (en) Information processing method, system, electronic device and readable storage medium
CN101753561B (en) Business cluster processing method and cluster system
CN104052723A (en) Information processing method and server
KR20120128013A (en) System and method for providing push service
US9369331B1 (en) Application message management
CN113553206B (en) Data event execution method and device, electronic equipment and computer readable medium
CN115629909A (en) Service data processing method and device, electronic equipment and storage medium
CN108989467B (en) Centralized addressing method
CN113660353A (en) Method, device, equipment and medium for managing Provisioner address based on Bluetooth Mesh
JP2017045463A (en) Information change notification service provision method and system for executing the same
AU2015416504B2 (en) Method and apparatus for server-based scheduling of network traffic to a mobile device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200508