CN109255091A - Method, apparatus, equipment and the computer readable storage medium of shared theme message - Google Patents

Method, apparatus, equipment and the computer readable storage medium of shared theme message Download PDF

Info

Publication number
CN109255091A
CN109255091A CN201810968429.8A CN201810968429A CN109255091A CN 109255091 A CN109255091 A CN 109255091A CN 201810968429 A CN201810968429 A CN 201810968429A CN 109255091 A CN109255091 A CN 109255091A
Authority
CN
China
Prior art keywords
business
subscriber
theme message
message
theme
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
CN201810968429.8A
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.)
Beijing Urban Network Neighbor Information Technology Co Ltd
Beijing City Network Neighbor Technology Co Ltd
Original Assignee
Beijing City Network Neighbor 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 Beijing City Network Neighbor Technology Co Ltd filed Critical Beijing City Network Neighbor Technology Co Ltd
Priority to CN201810968429.8A priority Critical patent/CN109255091A/en
Publication of CN109255091A publication Critical patent/CN109255091A/en
Pending legal-status Critical Current

Links

Landscapes

  • Computer And Data Communications (AREA)

Abstract

Invention describes method, apparatus, equipment and the computer readable storage mediums of a kind of shared theme message, this method comprises: according to the business demand of subscriber, theme message corresponding with the business demand is subscribed to from message queue, and by the theme message subscribed to storage into preset storage device;When subscriber needs using theme message, the theme message in the storage device is dumped in preset temporary file, and the theme message is respectively sent to corresponding subscriber, so that each subscriber carries out business execution using the theme message;When the business that detects executes failure, the theme message in the temporary file is sent to the subscriber that business executes failure, is executed so that the subscriber that business executes failure re-starts business using the theme message.The present invention can share theme message in multiple subscribers, and can reduce the expense of the system resources such as network transmission, queue storage.

Description

Method, apparatus, equipment and the computer readable storage medium of shared theme message
Technical field
The present invention relates to field of computer technology more particularly to a kind of method, apparatus, equipment and the meters of shared theme message Calculation machine readable storage medium storing program for executing.
Background technique
In the prior art, by repeatedly subscribing to the message of same subject to realize different business, alternatively, ordering by single The message of a certain theme is read, and reuses the theme message of subscription in multiple business.But it is repeatedly subscribed to if taken Mode will increase the burden of message server, need to consume more storages, and network transmission volume is also multiplied, and waste message Server resource, and repeatedly subscribe to also will to subscribe to method, system, network environment, the consumption such as cpu resource impact;If adopted The mode for taking single to subscribe to, each business serially executes the speed for reducing Message Processing, and wherein some business event ought occurs May cause follow-up business demand when barrier can not normally execute, and theme message is caused to be lost.
Summary of the invention
The main purpose of the embodiment of the present invention is to propose method, apparatus, equipment and the calculating of a kind of shared theme message Machine readable storage medium storing program for executing can share theme message in multiple subscribers, and can reduce network transmission, queue storage etc. be The expense for resource of uniting.
To achieve the above object, the embodiment of the invention provides a kind of methods of shared theme message, which comprises
According to the business demand of subscriber, theme message corresponding with the business demand is subscribed to from message queue, and By the theme message subscribed to storage into preset storage device;
When subscriber needs using theme message, the theme message in the storage device is dumped to preset interim In file, and the theme message is respectively sent to corresponding subscriber, so that each subscriber uses the theme message Carry out business execution;
When the business that detects executes failure, the theme message in the temporary file is sent to business and executes mistake The subscriber lost executes so that the subscriber that business executes failure re-starts business using the theme message.
Optionally, before the business that detects executes failure, the method also includes:
The service executing result for obtaining each subscriber the service executing result of each subscriber is recorded described interim In file and establish and the corresponding relationship of the theme message.
Optionally, described when the business that detects executes failure, the theme message in the temporary file is sent The subscriber of failure is executed to business, comprising:
When the business of all subscribers corresponding with the theme message, which executes, to be completed, according in the temporary file The service executing result of each subscriber of middle record detects whether that there are the subscribers that business executes failure;If so, by institute It states the theme message in temporary file and is sent to the subscriber that the business executes failure;If it is not, then the theme is disappeared Breath is deleted from the temporary file.
Optionally, the method also includes:
When the number of retries for re-starting business execution that business executes the subscriber of failure reaches the first preset threshold, Issue the first alert message;
Wherein, the first alert message includes: the information that number of retries reaches the subscriber of the first preset threshold.
Optionally, the method also includes:
Each subscriber carry out business execution during, judge each subscriber business execute duration whether be more than Second preset threshold stops if so, executing the subscriber that duration is more than the second preset threshold to business and sending business and execute Instruction, and the business that business execution duration is more than the subscriber of the second preset threshold is executed into knot in the temporary file Fruit is recorded as business and executes failure.
Optionally, the method also includes:
According to the default review time, storage time is periodically checked in the temporary file greater than third The theme message of preset threshold;If so, stopping corresponding greater than the theme message of third predetermined threshold value all with storage time Business executes, and issues the second alert message;
Wherein, the second alert message includes: the theme message that storage time is greater than the second preset threshold.
In addition, to achieve the above object, the embodiment of the present invention also proposes a kind of device of shared theme message, described device Include:
Subscribing module is subscribed to corresponding with the business demand for the business demand according to subscriber from message queue Theme message, and by the theme message subscribed to storage into preset storage device;
Execution module, for when subscriber needs using theme message, the theme message in the storage device to be turned It is stored in preset temporary file, and the theme message is respectively sent to corresponding subscriber, so that each subscriber makes Business execution is carried out with the theme message;
Processing module, for when the business that detects executes failure, the theme message in the temporary file to be sent out It send to business and executes the subscriber of failure, so that the subscriber that business executes failure re-starts business using the theme message It executes.
Optionally, described device further include:
Logging modle will for obtaining the service executing result of each subscriber before the business that detects executes failure The service executing result of each subscriber is recorded in the temporary file and establishes the corresponding relationship with the theme message;
The processing module, is specifically used for:
When the business of all subscribers corresponding with the theme message, which executes, to be completed, according in the temporary file The service executing result of each subscriber of middle record detects whether that there are the subscribers that business executes failure;If so, by institute It states the theme message in temporary file and is sent to the subscriber that the business executes failure;If it is not, then the theme is disappeared Breath is deleted from the temporary file.
In addition, to achieve the above object, the equipment that the embodiment of the present invention also proposes a kind of shared theme message, the equipment It include: processor, memory and communication bus;
The communication bus is for realizing the connection communication between the processor and the memory;
The processor is used to execute the program of the shared theme message stored in the memory, to realize above-mentioned introduction Shared theme message method the step of.
In addition, to achieve the above object, the embodiment of the present invention also proposes a kind of computer readable storage medium, the calculating Machine readable storage medium storing program for executing is stored with the program of shared theme message;
When the program of the shared theme message is executed by least one processor, lead at least one described processor The step of executing the method for shared theme message of above-mentioned introduction.
Method, apparatus, equipment and the computer readable storage medium for the shared theme message that the embodiment of the present invention proposes, from Theme message is subscribed in message queue, and the theme message of subscription is stored, and when executing business operation, acquisition has been stored Theme message, and theme message is shared in multiple business, to execute multi-service operation.Terminate in the execution of each business Afterwards, the implementing result of each business is recorded, and finally confirms implementing result.In addition, being monitored in the whole process and early warning. The embodiment of the present invention can reduce messaging, the resource consumption in reduction message queue use process, avoid because of service exception Caused by message subject the case where losing.
Detailed description of the invention
Fig. 1 is the flow chart of the method for the shared theme message of first embodiment of the invention;
Fig. 2 is the flow chart of the method for the shared theme message of second embodiment of the invention;
Fig. 3 is the flow chart of the method for the shared theme message of third embodiment of the invention;
Fig. 4 is the flow chart of the method for the shared theme message of fourth embodiment of the invention;
Fig. 5 is the composed structure schematic diagram of the device of the shared theme message of fifth embodiment of the invention;
Fig. 6 is the composed structure schematic diagram of the device of the shared theme message of sixth embodiment of the invention;
Fig. 7 is the process flow to theme message of the device of the shared theme message of use in sixth embodiment of the invention Schematic diagram;
Fig. 8 is the composed structure schematic diagram of the equipment of the shared theme message of seventh embodiment of the invention.
Specific embodiment
Further to illustrate that the embodiment of the present invention is the technical means and efficacy reaching predetermined purpose and being taken, tie below Attached drawing and preferred embodiment are closed, the embodiment of the present invention is described in detail as rear.
In order to solve the above-mentioned technical problem, first embodiment of the invention proposes a kind of method of shared theme message, such as Shown in Fig. 1, the method specifically includes the following steps:
Step S101: according to the business demand of subscriber, master corresponding with the business demand is subscribed to from message queue Message is inscribed, and by the theme message subscribed to storage into preset storage device.
Wherein, subscriber is the business for needing to subscribe to theme message.Some specific business need to use message queue, need Specific theme message is subscribed to from message queue, the relationship between theme message and business is driving relationship, theme message Driving business.
Step S102: when subscriber needs using theme message, the theme message in the storage device is dumped to In preset temporary file, and the theme message is respectively sent to corresponding subscriber, so that each subscriber uses institute It states theme message and carries out business execution.
It should be noted that no longer including the theme in storage device when theme message dumps in temporary file Message;Storage device is set and temporary file is the use state in order to distinguish theme message, the not subscribed theme just used Message stores in the storage device;The theme message just used is being subscribed to be stored in temporary file;When the industry of subscriber After business executes completion, theme message is deleted from temporary file.
Optionally, a temporary file can be only set and be not provided with storage device, and use shape in temporary file State is marked;By the not subscribed theme message just used labeled as being not used, the theme just used will be subscribed and disappeared Breath is labeled as in use, the theme message that business execution is completed is labeled as having used.
Step S103: when the business that detects executes failure, the theme message in the temporary file is sent to Business executes the subscriber of failure, holds so that the subscriber that business executes failure re-starts business using the theme message Row.
In embodiments of the present invention, the related subscriber of theme message can be monitored, it is each preferably to grasp The executive condition of subscriber, convenient for coordinating resource with better offer service;It, can be from interim simultaneously when business executes failure Theme message is easily called in file and is re-executed, so that it is guaranteed that the consistency of data.
Second embodiment of the invention proposes a kind of method of shared theme message, as shown in Fig. 2, the method is specific The following steps are included:
Step S201: according to the business demand of subscriber, master corresponding with the business demand is subscribed to from message queue Message is inscribed, and by the theme message subscribed to storage into preset storage device.
Step S202: when subscriber needs using theme message, the theme message in the storage device is dumped to In preset temporary file, and the theme message is respectively sent to corresponding subscriber, so that each subscriber uses institute It states theme message and carries out business execution.
Step S203: the service executing result (success or failure) of each subscriber is obtained, by the business of each subscriber Implementing result is recorded in the temporary file and establishes the corresponding relationship with the theme message.
Specifically, the method also includes:
The information (for example, noun of subscriber) for sharing each subscriber of the theme message is obtained, and is ordered each The information for the side of readding is stored into the temporary file.
Further, the method also includes:
The business for obtaining each subscriber executes duration, and described face is recorded in the business of each subscriber execution duration When file in.
In temporary file, comprising: theme message, the information of each subscriber corresponding with theme message and each The service executing result and business of subscriber executes duration.
Step S204: when the business of all subscribers corresponding with the theme message, which executes, to be completed, according in institute The service executing result for stating each subscriber recorded in temporary file detects whether that there are the subscribers that business executes failure;
If so, thening follow the steps S205;
If it is not, thening follow the steps S206.
Step S205: the theme message in the temporary file is sent to the subscription that the business executes failure Side executes so that the subscriber that business executes failure re-starts business using the theme message.
Step S206: the theme message is deleted from the temporary file.
It should be noted that no longer including the theme in storage device when theme message dumps in temporary file Message;Storage device is set and temporary file is the use state in order to distinguish theme message, the not subscribed theme just used Message stores in the storage device;The theme message just used is being subscribed to be stored in temporary file;When the industry of subscriber After business executes completion, theme message is deleted from temporary file.
Optionally, a temporary file can be only set and be not provided with storage device, and use shape in temporary file State is marked;By the not subscribed theme message just used labeled as being not used, the theme just used will be subscribed and disappeared Breath is labeled as in use, the theme message that business execution is completed is labeled as having used.
Third embodiment of the invention proposes a kind of method of shared theme message, as shown in figure 3, the method is specific The following steps are included:
Step S301: according to the business demand of subscriber, master corresponding with the business demand is subscribed to from message queue Message is inscribed, and by the theme message subscribed to storage into preset storage device.
Step S302: when subscriber needs using theme message, the theme message in the storage device is dumped to In preset temporary file, and the theme message is respectively sent to corresponding subscriber, so that each subscriber uses institute It states theme message and carries out business execution.
Specifically, the method also includes:
The information (for example, noun of subscriber) of each subscriber corresponding with the theme message is obtained, and will be each The information of subscriber stores into the temporary file and establishes the corresponding relationship with the theme message.
Step S303: the service executing result (success or failure) of each subscriber is obtained, by the business of each subscriber Implementing result is recorded in the temporary file and establishes the corresponding relationship with the theme message.
In temporary file, comprising: theme message, the information of each subscriber corresponding with theme message and each The service executing result of subscriber.
Step S304: when the business of all subscribers corresponding with the theme message, which executes, to be completed, according in institute The service executing result for stating each subscriber recorded in temporary file detects whether that there are the subscribers that business executes failure;
If so, thening follow the steps S305;
If it is not, thening follow the steps S308.
Step S305: judge whether the number of retries for re-starting business execution of the subscriber of business execution failure reaches First preset threshold;
If so, thening follow the steps S306;
If it is not, thening follow the steps S307.
Step S306: according to preset alert rule, the first alert message is issued;
Wherein, preset alert rule include: warning mode (such as: send mail, send short message, send wechat), warning People (that is, recipient of alert message), alert type (such as: it is single warning, continual warnings, alert according to set time period It accuses).
First alert message includes: that the information for the subscriber that number of retries reaches the first preset threshold and the theme disappear Breath.
Step S307: the theme message in the temporary file is sent to the subscription that the business executes failure Side executes so that the subscriber that business executes failure re-starts business using the theme message.
Step S308: the theme message is deleted from the temporary file.
Specifically, the method also includes:
Each subscriber carry out business execution during, judge each subscriber business execute duration whether be more than Second preset threshold stops if so, executing the subscriber that duration is more than the second preset threshold to business and sending business and execute Instruction, and the business that business execution duration is more than the subscriber of the second preset threshold is executed into knot in the temporary file Fruit is recorded as business and executes failure, so as to the later period theme message in the temporary file can be re-transmitted to it is described Business executes the subscriber that duration is more than the second preset threshold.
Further, the method also includes:
According to the default review time, storage time is periodically checked in the temporary file greater than third The theme message of preset threshold;If so, stopping corresponding greater than the theme message of third predetermined threshold value all with storage time Business executes, and according to preset alert rule, issues the second alert message;
Wherein, the second alert message include: storage time be greater than the second preset threshold theme message, and with the master Inscribe the information that the corresponding business of message executes the subscriber of failure.
Fourth embodiment of the invention proposes a kind of method of shared theme message, as shown in figure 4, the method is specific The following steps are included:
Step S401: according to the business demand of subscriber, master corresponding with the business demand is subscribed to from message queue Message is inscribed, and by the theme message subscribed to storage into preset storage device.
Step S402: when subscriber needs using theme message, the theme message in the storage device is dumped to In preset temporary file.
Step S403: subscriber corresponding with the theme message is obtained;
Step S404: judge whether to get subscriber corresponding with the theme message;
If so, thening follow the steps S405;
If it is not, being then finished.
Step S405: being respectively sent to corresponding subscriber for the theme message, for described in each subscriber's use Theme message carries out business execution.
Step S406: obtaining the service executing result of each subscriber, and the service executing result of each subscriber is recorded Into the temporary file and establish and the corresponding relationship of the theme message.
Step S407: when the business of all subscribers corresponding with the theme message, which executes, to be completed, according in institute The service executing result for stating each subscriber recorded in temporary file detects whether that there are the subscribers that business executes failure;
If so, thening follow the steps S408;
If it is not, thening follow the steps S411.
Step S408: judge whether the number of retries for re-starting business execution of the subscriber of business execution failure reaches First preset threshold;
If so, thening follow the steps S409;
If it is not, thening follow the steps S410.
Step S409: the business that the business executes failure is recorded in the temporary file;
Step S410: the theme message in the temporary file is sent to the subscription that the business executes failure Side executes so that the subscriber that business executes failure re-starts business using the theme message.
Step S411: the theme message is deleted from the temporary file.
Fifth embodiment of the invention proposes a kind of device of shared theme message, as shown in figure 5, described device is specific Including consisting of part:
Subscribing module 501 is subscribed to and the business demand pair from message queue for the business demand according to subscriber The theme message answered, and by the theme message subscribed to storage into preset storage device;
Execution module 502, for when subscriber needs using theme message, by the theme message in the storage device It dumps in preset temporary file, and the theme message is respectively sent to corresponding subscriber, for each subscriber Business execution is carried out using the theme message;
Processing module 503, for when detect business execute failure when, by the theme message in the temporary file It is sent to the subscriber that business executes failure, so that the subscriber that business executes failure re-starts industry using the theme message Business executes.
Specifically, described device further include:
Logging modle will for obtaining the service executing result of each subscriber before the business that detects executes failure The service executing result of each subscriber is recorded in the temporary file and establishes the corresponding relationship with the theme message.
Further, the execution module 502, is also used to:
Each subscriber carry out business execution during, judge each subscriber business execute duration whether be more than Second preset threshold stops if so, executing the subscriber that duration is more than the second preset threshold to business and sending business and execute Instruction, and the business that business execution duration is more than the subscriber of the second preset threshold is executed into knot in the temporary file Fruit is recorded as business and executes failure.
Further, the processing module 503, is specifically used for:
When the business of all subscribers corresponding with the theme message, which executes, to be completed, according in the temporary file The service executing result of each subscriber of middle record detects whether that there are the subscribers that business executes failure;If so, by institute It states the theme message in temporary file and is sent to the subscriber that the business executes failure;If it is not, then the theme is disappeared Breath is deleted from the temporary file.
Further, described device further include:
Alarm module reaches for executing the number of retries for re-starting business execution of subscriber of failure when business When one preset threshold, the first alert message is issued;Wherein, the first alert message includes: that number of retries reaches the first preset threshold Subscriber information.
Further, the alarm module, is also used to:
According to the default review time, storage time is periodically checked in the temporary file greater than third The theme message of preset threshold;If so, stopping corresponding greater than the theme message of third predetermined threshold value all with storage time Business executes, and issues the second alert message;Wherein, the second alert message includes: that storage time is greater than the second preset threshold Theme message.
Sixth embodiment of the invention proposes a kind of device of shared theme message, as shown in fig. 6, described device is specific Including consisting of part:
Dump module 10 is cached, subscribes to theme message from message queue for the business demand according to subscriber, and will The theme message subscribed to is saved in preset storage device (for example, redis, herein without limitation) for future use.
Specifically, caching dump module 10, comprising:
Subscriber units 101 are subscribed to from message queue and the business demand pair for the business demand according to subscriber The theme message answered;
Storage unit 102, for the theme message subscribed to be saved in order in preset storage device.
Further, subscriber units 101 and memory module 102 can not restart service by way of configuring In the case of carry out hot loading configuration file, with increase immediately, update, delete subscriber needs theme message.It needs to illustrate It is that heat load is a kind of technology for not needing the new content that restarting systems can be got in the configuration file of change. When subscriber is newly-increased, deletes the theme message for needing to subscribe to, alternatively, modification is for subscribing to message and depositing when change storage device The configuration file of message, subscriber units 101 and memory module 102 are stored up by way of heat load, to obtain modified configuration Configuration information in file, to achieve the effect that immediate updating configuration information in the case where not restarting systems.
Shared execution module 20, for obtaining theme message in order from the storage device, by the theme message It is cached in preset temporary file, then subscriber executes business operation one by one, while the business for saving each subscriber is held Row result (success or failure), initiates the event being finished after all subscribers are finished.
Specifically, shared execution module 20, comprising:
The theme message is cached to default by reading unit 201 for obtaining theme message from the storage device Temporary file in;
It should be noted that the theme message obtained from storage device can not be looked into the storage device;That is, theme After taking out in storage device, other threads (including: thread, process, service etc.) can not obtain in the storage device message again The theme message is taken, to avoid the theme message from being reused, to ensure that the theme message will not be repeated consumption;This Outside, the temporary file in the embodiment of the present invention is for saving theme message in execution.
Execution unit 202 multiple shares the theme for the theme message in the temporary file to be respectively sent to The subscriber of message, so that each subscriber executes business operation by parameter of the theme message respectively;And obtain each order The service executing result (include: normal termination be denoted as true and abnormal ending is denoted as false) and business for the side of readding execute duration, will The service executing result and business of each subscriber executes duration and stores into the temporary file;
It should be noted that the service executing result of the subscriber is obtained after each subscriber has executed business operation, And it stores into the temporary file;
Further, execution unit 202 are also used to:
Before theme message is sent to subscriber, each subscriber for sharing the theme message is registered, And by the registration information of each subscriber (for example, title of subscriber) storage into the temporary file, for later period confirmation Whether it is executed normally by each subscriber;
Further, execution unit 202 are also used to:
The execution duration for monitoring each subscriber stops executing industry when the execution duration of subscriber is more than preset threshold Business operation re-executes business operation.
It should be noted that in embodiments of the present invention, each subscriber can be executed or using serial using simultaneously Row executes.
Notification unit 203, for sending out when all subscribers corresponding with the theme message have been performed both by business operation Completion notice event is played, for subsequent confirmation;
Further, notification unit 203, for being performed both by business behaviour as all subscribers for sharing the theme message (failure is either run succeeded or executed) when making, the confirmation unit 302 into monitoring confirmation module 30 sends business and executes Finish notice, for confirmation unit 302 the business of obtaining be finished notice after to whether all subscribers have normally executed At carrying out inspection confirmation.
Administrative unit 204 executes business behaviour for starting some subscriber execution business behaviour or stopping some subscriber Make.
Confirmation module 30 is monitored, for checking whether each subscriber for sharing the theme message has normally executed industry Business operation;When discovery there are when the subscriber of business operation exception, the subscriber of business operation exception is retried and/or is remembered Record the subscriber of business operation exception.
Specifically, monitoring confirmation module 30, comprising:
Configuration unit 301, for storage duration threshold value in temporary file of arrangement abnormalities number of retries, theme message, The abnormity early warning value of subscriber, executes abnormal processing strategie at the processing strategie of overtime theme message in temporary file;
Wherein, abnormal number of retries refers to, when the business operation exception of a certain subscriber, re-executes to the subscriber The maximum number of times of business operation;
The abnormity early warning value of subscriber refers to, the abnormity early warning value of various latitudes, such as: when executing the execution of business operation The quantity of the subscriber of length, the business operation frequency of abnormity in the unit time, execution business operation time-out;
The processing strategie of overtime theme message in temporary file refers to, when a certain theme message depositing in temporary file When storage duration is more than storage duration threshold value of the theme message in temporary file, stop the subscriber's for sharing the theme message Business operation;
Executing abnormal processing strategie includes: to stop executing business operation and re-execute business operation.
Confirmation unit 302, the completion notice thing sent for responding the notification unit 203 in shared execution module 20 Part;According to the service executing result of each subscriber stored in the temporary file, it is different to judge whether there is business operation Normal subscriber;If so, the theme message in the temporary file to be sent to the subscription of the business operation exception Side, so that the subscriber of the business operation exception re-executes business operation;If it is not, then the theme message is faced from described When file in delete;
Further, confirmation unit 302 are also used to:
According to the default review time, storage time is periodically checked in the temporary file greater than default The theme message of threshold value;If so, the business operation for the subscriber not executed normally to it retries or stopping processing.
Monitoring unit 303 is monitored for the executive condition to execution unit 202 and to temporary file.
Further, monitoring unit 303 are specifically used for:
To the storage duration of quantity, theme message in temporary file of business operation exception, the theme in temporary file The quantity of message is monitored.
Prewarning unit 304, for carrying out early warning configuration, and the number provided according to the early warning configuration and monitoring unit 303 According to progress early warning.
Specific early warning value, early warning people, alarm mode (for example, mail, short message, wechat), early warning are set in early warning configuration Type (for example, needing to set the early warning period when single early warning, multiple early warning, multiple early warning).
It should be noted that caching dump module 10, shared execution module 20, monitoring confirmation mould in the embodiment of the present invention Block 30 can be synchronous execute and be also possible to asynchronous execution.
The embodiment of the present invention ensures theme by caching dump module 10, shared execution module 20, monitoring confirmation module 30 The quick reception of message, efficient process are more reasonably to utilize system resource, Internet resources etc..
As shown in fig. 7, for using the processing flow schematic diagram to theme message of the device of above-mentioned shared theme message.Its In, business A, business B, business C, business D share a theme message, after each business executes completion, it may appear that normal End or two kinds of situations of abnormal ending.In the case where normal termination, each equal business of business runs succeeded;In abnormal ending In the case of, the business of at least one business executes failure.Confirmation module 30 can carry out phase according to normal termination or abnormal ending The processing answered.
Seventh embodiment of the invention proposes a kind of equipment of shared theme message, as shown in figure 8, the equipment includes: Processor 801, memory 802 and communication bus;
The communication bus is for realizing the connection communication between processor 801 and memory 802;
Processor 801 is used to execute the program of the shared theme message stored in memory 802, to perform the steps of
According to the business demand of subscriber, theme message corresponding with the business demand is subscribed to from message queue, and By the theme message subscribed to storage into preset storage device;
When subscriber needs using theme message, the theme message in the storage device is dumped to preset interim In file, and the theme message is respectively sent to corresponding subscriber, so that each subscriber uses the theme message Carry out business execution;
When the business that detects executes failure, the theme message in the temporary file is sent to business and executes mistake The subscriber lost executes so that the subscriber that business executes failure re-starts business using the theme message.
Eighth embodiment of the invention proposes a kind of computer readable storage medium, the computer readable storage medium It is stored with the program of shared theme message;
When the program of the shared theme message is executed by least one processor, lead at least one described processor Execute following steps operation:
According to the business demand of subscriber, theme message corresponding with the business demand is subscribed to from message queue, and By the theme message subscribed to storage into preset storage device;
When subscriber needs using theme message, the theme message in the storage device is dumped to preset interim In file, and the theme message is respectively sent to corresponding subscriber, so that each subscriber uses the theme message Carry out business execution;
When the business that detects executes failure, the theme message in the temporary file is sent to business and executes mistake The subscriber lost executes so that the subscriber that business executes failure re-starts business using the theme message.
Method, apparatus, equipment and the computer readable storage medium for the shared theme message introduced in the embodiment of the present invention, Theme message is subscribed to from message queue, and the theme message of subscription is stored, and when executing business operation, acquisition has been deposited The theme message of storage, and theme message is shared in multiple business, to execute multi-service operation.Terminate in the execution of each business Afterwards, the implementing result of each business is recorded, and finally confirms implementing result.In addition, being monitored in the whole process and early warning. The embodiment of the present invention can reduce messaging, the resource consumption in reduction message queue use process, avoid because of service exception Caused by message subject the case where losing.
It should be able to be the technology reaching predetermined purpose and being taken to the embodiment of the present invention by the explanation of specific embodiment Means and effect are able to more deeply and specifically understand, however appended diagram is only to provide reference and description and is used, and not uses To be limited to the embodiment of the present invention.

Claims (10)

1. a kind of method of shared theme message, which is characterized in that the described method includes:
According to the business demand of subscriber, theme message corresponding with the business demand is subscribed to from message queue, and will order The theme message read is stored into preset storage device;
When subscriber needs using theme message, the theme message in the storage device is dumped into preset temporary file In, and the theme message is respectively sent to corresponding subscriber, so that each subscriber is carried out using the theme message Business executes;
When the business that detects executes failure, the theme message in the temporary file is sent to business and executes failure Subscriber executes so that the subscriber that business executes failure re-starts business using the theme message.
2. the method for shared theme message according to claim 1, which is characterized in that execute failure in the business that detects Before, the method also includes:
The temporary file is recorded in the service executing result of each subscriber by the service executing result for obtaining each subscriber In and establish and the corresponding relationship of the theme message.
3. the method for shared theme message according to claim 2, which is characterized in that described to detect that business executes mistake When losing, the theme message in the temporary file is sent to the subscriber that business executes failure, comprising:
When the business of all subscribers corresponding with the theme message, which executes, to be completed, remember according in the temporary file The service executing result of each subscriber of record detects whether that there are the subscribers that business executes failure;If so, facing described When file in the theme message be sent to the subscriber that the business executes failure;If it is not, then by the theme message from It is deleted in the temporary file.
4. the method for shared theme message according to claim 1, which is characterized in that the method also includes:
When the number of retries for re-starting business execution that business executes the subscriber of failure reaches the first preset threshold, issue First alert message;
Wherein, the first alert message includes: the information that number of retries reaches the subscriber of the first preset threshold.
5. the method for shared theme message according to claim 1, which is characterized in that the method also includes:
During each subscriber carries out business execution, judge that whether the business of each subscriber executes duration more than second Preset threshold executes the instruction stopped if so, executing the subscriber that duration is more than the second preset threshold to business and sending business, And the service executing result that business execution duration is more than the subscriber of the second preset threshold is remembered in the temporary file Record is that business executes failure.
6. the method for shared theme message according to claim 1, which is characterized in that the method also includes:
According to the default review time, it is default greater than third that storage time is periodically checked in the temporary file The theme message of threshold value;If so, stopping all business corresponding greater than the theme message of third predetermined threshold value with storage time It executes, and issues the second alert message;
Wherein, the second alert message includes: the theme message that storage time is greater than the second preset threshold.
7. a kind of device of shared theme message, which is characterized in that described device includes:
Subscribing module subscribes to master corresponding with the business demand for the business demand according to subscriber from message queue Message is inscribed, and by the theme message subscribed to storage into preset storage device;
Execution module, for when subscriber needs using theme message, the theme message in the storage device to be dumped to In preset temporary file, and the theme message is respectively sent to corresponding subscriber, so that each subscriber uses institute It states theme message and carries out business execution;
Processing module, for when the business that detects executes failure, the theme message in the temporary file to be sent to Business executes the subscriber of failure, holds so that the subscriber that business executes failure re-starts business using the theme message Row.
8. the device of shared theme message according to claim 7, which is characterized in that described device further include:
Logging modle will be each for obtaining the service executing result of each subscriber before the business that detects executes failure The service executing result of subscriber is recorded in the temporary file and establishes the corresponding relationship with the theme message;
The processing module, is specifically used for:
When the business of all subscribers corresponding with the theme message, which executes, to be completed, remember according in the temporary file The service executing result of each subscriber of record detects whether that there are the subscribers that business executes failure;If so, facing described When file in the theme message be sent to the subscriber that the business executes failure;If it is not, then by the theme message from It is deleted in the temporary file.
9. a kind of equipment of shared theme message, which is characterized in that the equipment includes: processor, memory and communication bus;
The communication bus is for realizing the connection communication between the processor and the memory;
The processor is used to execute the program of the shared theme message stored in the memory, to realize claim 1 to 6 Any one of described in shared theme message method the step of.
10. a kind of computer readable storage medium, which is characterized in that the computer-readable recording medium storage has shared theme The program of message;
When the program of the shared theme message is executed by least one processor, at least one described processor is caused to execute The step of method of shared theme message described in any one of claims 1 to 6.
CN201810968429.8A 2018-08-23 2018-08-23 Method, apparatus, equipment and the computer readable storage medium of shared theme message Pending CN109255091A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810968429.8A CN109255091A (en) 2018-08-23 2018-08-23 Method, apparatus, equipment and the computer readable storage medium of shared theme message

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810968429.8A CN109255091A (en) 2018-08-23 2018-08-23 Method, apparatus, equipment and the computer readable storage medium of shared theme message

Publications (1)

Publication Number Publication Date
CN109255091A true CN109255091A (en) 2019-01-22

Family

ID=65050394

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810968429.8A Pending CN109255091A (en) 2018-08-23 2018-08-23 Method, apparatus, equipment and the computer readable storage medium of shared theme message

Country Status (1)

Country Link
CN (1) CN109255091A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113301558A (en) * 2020-06-29 2021-08-24 阿里巴巴集团控股有限公司 Message transmission method, device, system and storage medium
CN113742617A (en) * 2020-08-28 2021-12-03 北京沃东天骏信息技术有限公司 Cache updating method and device
CN113794597A (en) * 2021-09-15 2021-12-14 中国联合网络通信集团有限公司 Alarm information processing method, system, electronic device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102355475A (en) * 2011-06-29 2012-02-15 北京思创银联科技股份有限公司 Information subscription system
CN102377685A (en) * 2010-08-06 2012-03-14 阿里巴巴集团控股有限公司 Subscription message sending system and subscription message sending method
CN106657349A (en) * 2016-12-29 2017-05-10 上海理想信息产业(集团)有限公司 Message subscription processing device, system and method
CN106648444A (en) * 2015-10-30 2017-05-10 大唐移动通信设备有限公司 Message processing method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102377685A (en) * 2010-08-06 2012-03-14 阿里巴巴集团控股有限公司 Subscription message sending system and subscription message sending method
CN102355475A (en) * 2011-06-29 2012-02-15 北京思创银联科技股份有限公司 Information subscription system
CN106648444A (en) * 2015-10-30 2017-05-10 大唐移动通信设备有限公司 Message processing method and device
CN106657349A (en) * 2016-12-29 2017-05-10 上海理想信息产业(集团)有限公司 Message subscription processing device, system and method

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113301558A (en) * 2020-06-29 2021-08-24 阿里巴巴集团控股有限公司 Message transmission method, device, system and storage medium
CN113301558B (en) * 2020-06-29 2022-09-27 阿里巴巴集团控股有限公司 Message transmission method, device, system and storage medium
CN113742617A (en) * 2020-08-28 2021-12-03 北京沃东天骏信息技术有限公司 Cache updating method and device
CN113794597A (en) * 2021-09-15 2021-12-14 中国联合网络通信集团有限公司 Alarm information processing method, system, electronic device and storage medium
CN113794597B (en) * 2021-09-15 2023-05-30 中国联合网络通信集团有限公司 Alarm information processing method, system, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109255091A (en) Method, apparatus, equipment and the computer readable storage medium of shared theme message
CN109743358A (en) Asynchronous message interface fusing control method, device, computer equipment and storage medium
CN109710394A (en) Timing task processing system and method
CN109788068B (en) Heartbeat state information reporting method, device and equipment and computer storage medium
CN102571850B (en) Transaction committing system, method and equipment
CN110231995B (en) Task scheduling method, device and storage medium based on Actor model
CN104092719A (en) File transmission method, device and distributed cluster file system
CN109766194B (en) Method and system for realizing low-coupling plan task component based on message
CN110166529A (en) It keeps logging in state method, apparatus, equipment and storage medium
CN112069266A (en) Data synchronization method and service node
CN112579356A (en) Fault processing method and server
CN109495528A (en) Distributed lock ownership dispatching method and device
CN114385378A (en) Active data processing method and device for Internet of things equipment and storage medium
CN107483635A (en) Service request processing method, processing system and message middleware
CN115190052A (en) Long connection management method, system and control unit
CN109274548A (en) A kind of method for monitoring application program, computer readable storage medium and terminal device
CN115167297A (en) Intelligent manufacturing industry Internet of things based on thread control and control method
CN108805741B (en) Fusion method, device and system of power quality data
CN110443598B (en) Account settlement method and device
CN106331036B (en) Server control method and device
CN112463514A (en) Monitoring method and device for distributed cache cluster
CN112055058A (en) Data storage method and device and computer readable storage medium
CN114422333B (en) Message consumption method and system based on message middleware back pressure
CN115580610B (en) Batch file uploading method, device, equipment and readable storage medium
CN108184141B (en) Processing method of monitoring video task and server

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

Application publication date: 20190122

RJ01 Rejection of invention patent application after publication