[go: up one dir, main page]

CN107896172B - Monitoring failure processing method and device, storage medium and electronic device - Google Patents

Monitoring failure processing method and device, storage medium and electronic device Download PDF

Info

Publication number
CN107896172B
CN107896172B CN201711193568.XA CN201711193568A CN107896172B CN 107896172 B CN107896172 B CN 107896172B CN 201711193568 A CN201711193568 A CN 201711193568A CN 107896172 B CN107896172 B CN 107896172B
Authority
CN
China
Prior art keywords
message
queue
listener
monitoring
message queue
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.)
Active
Application number
CN201711193568.XA
Other languages
Chinese (zh)
Other versions
CN107896172A (en
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.)
Taikang Insurance Group Co Ltd
Original Assignee
Taikang Insurance Group 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 Taikang Insurance Group Co Ltd filed Critical Taikang Insurance Group Co Ltd
Priority to CN201711193568.XA priority Critical patent/CN107896172B/en
Publication of CN107896172A publication Critical patent/CN107896172A/en
Application granted granted Critical
Publication of CN107896172B publication Critical patent/CN107896172B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0817Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0659Management of faults, events, alarms or notifications using network fault recovery by isolating or reconfiguring faulty entities
    • H04L41/0661Management of faults, events, alarms or notifications using network fault recovery by isolating or reconfiguring faulty entities by reconfiguring faulty entities

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a monitoring fault processing method and device, a storage medium and electronic equipment, and relates to the technical field of data communication. The monitoring fault processing method is applied to a system comprising a message queue and a message consumption end, and comprises the following steps: decoupling a message listener from a message processing application at a message consuming end; monitoring the message queue, and if the abnormal message queue exists in the message queue, notifying the abnormal message queue to a monitoring manager of a message consumption end through a predetermined channel; the monitoring manager determines a message monitor corresponding to the abnormal message queue as a target monitor; the target listener is detected to restart the target listener in the event that a failure of the target listener is detected. The invention can solve the problem of message queue abnormity caused by monitor fault, and can realize the design requirement of high cohesion and low coupling by decoupling the monitor and the message processing application.

Description

监听故障处理方法及装置、存储介质和电子设备Monitoring failure processing method and device, storage medium and electronic device

技术领域technical field

本发明涉及数据通信技术领域,具体而言,涉及一种监听故障处理方法、监听故障处理装置、存储介质和电子设备。The present invention relates to the technical field of data communication, and in particular, to a monitoring fault processing method, a monitoring fault processing device, a storage medium and an electronic device.

背景技术Background technique

随着社会信息化的发展,各业务系统之间的数据交互越来越频繁。目前,在各业务系统之间往往采用RabbitMQ(一种数据通信方法)来实现数据交互。具体的,首先,消息生产端(Producer)可以将消息发送至消息交换机(Exchange);随后,消息交换机可以将消息分发给各个与消息交换机绑定的队列(Queue);另外,消息消费端(Consumer)可以通过监听器(Monitor)对队列进行监听,并且在队列中的消息被消息消费端监听到并处理完之后,消息消费端可以反馈回叫(Callback)至队列;接下来,队列可以将当前消息清除。由此,当前数据交互处理结束。With the development of social informatization, data interaction between various business systems is becoming more and more frequent. At present, RabbitMQ (a data communication method) is often used between various business systems to realize data interaction. Specifically, first, the message producer (Producer) can send the message to the message exchange (Exchange); then, the message exchange can distribute the message to each queue (Queue) bound to the message exchange; in addition, the message consumer (Consumer) ) can monitor the queue through the monitor (Monitor), and after the message in the queue is monitored and processed by the message consumer, the message consumer can feed back a Callback to the queue; next, the queue can send the current Message cleared. Thus, the current data interaction process ends.

然而,一方面,目前存在由于监听器宕机等原因导致队列中消息长度堆积过高的问题;另一方面,针对消息消费端,监听器与具体处理消息的的消息处理应用的耦合度较高,在对监听器或消息处理应用进行代码维护或在项目迭代时,开发人员修改某一处代码可能导致整个系统的错误,这不满足高内聚低耦合的设计要求。However, on the one hand, there is a problem that the length of messages in the queue is too high due to the downtime of the listener; , During code maintenance of listeners or message processing applications or during project iteration, developers modifying a certain code may cause errors in the entire system, which does not meet the design requirements of high cohesion and low coupling.

鉴于此,需要一种监听故障处理方法、监听故障处理装置、存储介质和电子设备。In view of this, there is a need for a monitoring fault processing method, a monitoring fault processing device, a storage medium and an electronic device.

需要说明的是,在上述背景技术部分公开的信息仅用于加强对本发明的背景的理解,因此可以包括不构成对本领域普通技术人员已知的现有技术的信息。It should be noted that the information disclosed in the above Background section is only for enhancing understanding of the background of the invention, and therefore may contain information that does not form the prior art known to a person of ordinary skill in the art.

发明内容SUMMARY OF THE INVENTION

本发明的目的在于提供一种监听故障处理方法、监听故障处理装置、存储介质和电子设备,进而至少在一定程度上克服由于相关技术的限制和缺陷而导致的一个或者多个问题。The purpose of the present invention is to provide a monitoring fault processing method, monitoring fault processing device, storage medium and electronic equipment, thereby at least to a certain extent overcoming one or more problems caused by the limitations and defects of the related art.

根据本发明的一个方面,提供一种监听故障处理方法,应用于包括消息队列和消息消费端的系统,监听故障处理方法包括:According to an aspect of the present invention, a monitoring fault processing method is provided, which is applied to a system including a message queue and a message consumer, and the monitoring fault processing method includes:

在消息消费端将消息监听器与消息处理应用解耦;Decouple message listeners from message processing applications on the message consumer side;

对消息队列进行监测,如果监测出消息队列中存在异常消息队列,则通过预定通道将异常消息队列通知给消息消费端的监听管理器;Monitor the message queue. If an abnormal message queue is detected in the message queue, the abnormal message queue will be notified to the monitoring manager of the message consumer through a predetermined channel;

监听管理器确定与异常消息队列对应的消息监听器作为目标监听器;The listening manager determines the message listener corresponding to the exception message queue as the target listener;

对目标监听器进行检测以便在检测出目标监听器故障的情况下重启目标监听器。The target listener is detected to restart the target listener if a target listener failure is detected.

可选地,将消息监听器与消息处理应用解耦包括:Optionally, decoupling the message listener from the message processing application includes:

对消息处理应用进行注册;Register the message processing application;

获取来自消息处理应用的消息传输条件;Get the message transmission conditions from the message processing application;

根据消息传输条件将消息经由消息监听器发送至对应的消息处理应用。The message is sent to the corresponding message processing application via the message listener according to the message transmission condition.

可选地,监听故障处理方法还包括:Optionally, the monitoring fault processing method further includes:

采用RESTful架构实现消息监听器与消息处理应用之间的数据传输。The RESTful architecture is used to realize the data transmission between the message listener and the message processing application.

可选地,通过预定通道将异常消息队列通知给消息消费端的监听管理器包括:Optionally, the monitoring manager that notifies the abnormal message queue to the message consumer through a predetermined channel includes:

通过HTTP协议或RESTful接口将异常消息队列通知给消息消费端的监听管理器。Notify the abnormal message queue to the monitoring manager of the message consumer through the HTTP protocol or the RESTful interface.

可选地,异常消息队列为队列长度异常的消息队列;Optionally, the abnormal message queue is a message queue with abnormal queue length;

其中,对消息队列进行监测包括:Among them, monitoring the message queue includes:

判断消息队列的长度是否异常。Determine whether the length of the message queue is abnormal.

可选地,监听管理器确定与异常消息队列对应的消息监听器作为目标监听器包括:Optionally, the monitoring manager determining the message listener corresponding to the exception message queue as the target listener includes:

监听管理器根据消息监听器与消息队列之间的对应关系表确定与异常消息队列对应的消息监听器作为目标监听器。The monitoring manager determines the message listener corresponding to the abnormal message queue as the target listener according to the correspondence table between the message listener and the message queue.

可选地,监听故障处理方法还包括:Optionally, the monitoring fault processing method further includes:

在检测出目标监听器故障的情况下,发送报警信号。In the event that a target listener failure is detected, an alarm signal is sent.

根据本发明的一个方面,提供一种监听故障处理系统,包括消息队列和消息消费端,监听故障处理系统还包括:According to one aspect of the present invention, a monitoring fault processing system is provided, including a message queue and a message consumer, and the monitoring fault processing system further includes:

解耦模块,用于在消息消费端将消息监听器与消息处理应用解耦;The decoupling module is used to decouple the message listener from the message processing application on the message consumer side;

队列监测模块,用于对消息队列进行监测,并在监测出消息队列中存在异常消息队列时,通过预定通道将异常消息队列通知给消息消费端的监听管理器;The queue monitoring module is used to monitor the message queue, and when it is detected that there is an abnormal message queue in the message queue, it will notify the monitoring manager of the message consumer end of the abnormal message queue through a predetermined channel;

监听管理器,用于确定与异常消息队列对应的消息监听器作为目标监听器,对目标监听器进行检测以便在检测出目标监听器故障的情况下重启目标监听器。The monitoring manager is used for determining the message listener corresponding to the abnormal message queue as the target listener, and detecting the target listener so as to restart the target listener in the case of detecting the failure of the target listener.

可选地,解耦模块包括:Optionally, the decoupling module includes:

处理应用注册单元,用于对消息处理应用进行注册;a processing application registration unit for registering message processing applications;

传输条件获取单元,用于获取来自消息处理应用的消息传输条件;a transmission condition acquisition unit, used to acquire the message transmission conditions from the message processing application;

消息发送单元,用于根据消息传输条件将消息经由消息监听器发送至对应的消息处理应用。The message sending unit is configured to send the message to the corresponding message processing application via the message listener according to the message transmission condition.

可选地,监听故障处理装置还包括:Optionally, the monitoring fault processing device further includes:

数据传输模块,用于采用RESTful架构实现消息监听器与消息处理应用之间的数据传输。The data transmission module is used to realize the data transmission between the message listener and the message processing application using the RESTful architecture.

可选地,队列监测模块包括:Optionally, the queue monitoring module includes:

异常队列通知单元,用于在监测出消息队列中存在异常消息队列时,通过HTTP协议或RESTful接口将异常消息队列通知给消息消费端的监听管理器。The abnormal queue notification unit is used to notify the monitoring manager of the message consumer end of the abnormal message queue through the HTTP protocol or the RESTful interface when an abnormal message queue is detected in the message queue.

可选地,异常消息队列为队列长度异常的消息队列;Optionally, the abnormal message queue is a message queue with abnormal queue length;

其中,队列监测模块还包括:Among them, the queue monitoring module also includes:

长度异常判断单元,用于判断消息队列的长度是否异常。The length abnormality judgment unit is used to judge whether the length of the message queue is abnormal.

可选地,监听管理器包括:Optionally, the listening manager includes:

监听单元,用于监听管理器根据消息监听器与消息队列之间的对应关系表确定与异常消息队列对应的消息监听器作为目标监听器。The monitoring unit is used for the monitoring manager to determine the message listener corresponding to the abnormal message queue as the target listener according to the correspondence table between the message listener and the message queue.

可选地,监听管理器还包括:Optionally, the listening manager further includes:

报警信号发送单元,用于在检测出目标监听器故障的情况下,发送报警信号。The alarm signal sending unit is used for sending an alarm signal in the case of detecting the failure of the target listener.

根据本发明的一个方面,提供一种存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述任意一项的监听故障处理方法。According to one aspect of the present invention, there is provided a storage medium on which a computer program is stored, and when the computer program is executed by a processor, any one of the above-mentioned monitoring fault processing methods is implemented.

根据本发明的一个方面,提供一种电子设备,包括:According to one aspect of the present invention, an electronic device is provided, comprising:

处理器;以及processor; and

存储器,用于存储处理器的可执行指令;memory for storing executable instructions for the processor;

其中,处理器配置为经由执行可执行指令来执行上述任意一项的监听故障处理方法。Wherein, the processor is configured to execute any one of the above monitoring fault processing methods by executing the executable instructions.

在本发明的一些实施例所提供的技术方案中,通过将消息监听器与消息处理应用解耦,监测异常消息队列,并确定异常消息队列对应的监听器作为目标监听器,检测目标监听器并在目标监听器故障时重启目标监听器,一方面,通过自动重启监听器,可以解决监听器故障导致消息队列异常的问题而无需人工参与;另一方面,将消息监听器与消息处理应用解耦,可以避免在进行代码维护或项目迭代时,由于修改某一处代码导致整个系统错误的问题,实现了高内聚低耦合的设计要求。In the technical solutions provided by some embodiments of the present invention, by decoupling the message listener from the message processing application, monitoring the abnormal message queue, and determining the listener corresponding to the abnormal message queue as the target listener, detecting the target listener and Restarting the target listener when the target listener fails , which can avoid the problem that the entire system is wrong due to modification of a certain code during code maintenance or project iteration, and achieves the design requirements of high cohesion and low coupling.

应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.

附图说明Description of drawings

此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本发明的实施例,并与说明书一起用于解释本发明的原理。显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。在附图中:The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description serve to explain the principles of the invention. Obviously, the drawings in the following description are only some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative effort. In the attached image:

图1示意性示出了现有技术中一些方案的基于RabbitMQ模式的数据通信的方框图;1 schematically shows a block diagram of data communication based on the RabbitMQ mode of some solutions in the prior art;

图2示意性示出了根据本发明的示例性实施方式的监听故障处理方法的流程图;FIG. 2 schematically shows a flowchart of a method for processing a monitoring fault according to an exemplary embodiment of the present invention;

图3示意性示出了根据本发明的示例性实施方式的将消息监听器与消息处理应用解耦后的数据通信的方框图;3 schematically shows a block diagram of data communication after decoupling a message listener from a message processing application according to an exemplary embodiment of the present invention;

图4示意性示出了采用本发明的示例性实施方式的监听故障处理方法的数据通信的方框图;FIG. 4 schematically shows a block diagram of data communication using the monitoring method for fault handling according to an exemplary embodiment of the present invention;

图5示意性示出了根据本发明的示例性实施方式的监听故障处理系统的方框图;FIG. 5 schematically shows a block diagram of a monitoring fault processing system according to an exemplary embodiment of the present invention;

图6示意性示出了根据本发明的示例性实施方式的解耦模块的方框图;FIG. 6 schematically shows a block diagram of a decoupling module according to an exemplary embodiment of the present invention;

图7示意性示出了根据本发明的示例性实施方式的监听故障处理系统的另一方框图;FIG. 7 schematically shows another block diagram of a monitoring fault processing system according to an exemplary embodiment of the present invention;

图8示意性示出了根据本发明的示例性实施方式的队列监测模块的方框图;FIG. 8 schematically shows a block diagram of a queue monitoring module according to an exemplary embodiment of the present invention;

图9示意性示出了根据本发明的示例性实施方式的队列监测模块的另一方框图;FIG. 9 schematically shows another block diagram of a queue monitoring module according to an exemplary embodiment of the present invention;

图10示意性示出了根据本发明的示例性实施方式的监听管理器的方框图;Figure 10 schematically shows a block diagram of a listening manager according to an exemplary embodiment of the present invention;

图11示意性示出了根据本发明的示例性实施方式的监听管理器的另一方框图;FIG. 11 schematically shows another block diagram of a listening manager according to an exemplary embodiment of the present invention;

图12示出了根据本发明的示例性实施方式的存储介质的示意图;以及FIG. 12 shows a schematic diagram of a storage medium according to an exemplary embodiment of the present invention; and

图13示意性示出了根据本发明的示例性实施方式的电子设备的方框图。Figure 13 schematically shows a block diagram of an electronic device according to an exemplary embodiment of the present invention.

具体实施方式Detailed ways

现在将参考附图更全面地描述示例实施方式。然而,示例实施方式能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施方式使得本公开将更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施方式中。在下面的描述中,提供许多具体细节从而给出对本发明的实施方式的充分理解。然而,本领域技术人员将意识到,可以实践本发明的技术方案而省略所述特定细节中的一个或更多,或者可以采用其它的方法、组元、装置、步骤等。在其它情况下,不详细示出或描述公知技术方案以避免喧宾夺主而使得本公开的各方面变得模糊。Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments, however, can be embodied in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided in order to give a thorough understanding of the embodiments of the present invention. However, those skilled in the art will appreciate that the technical solutions of the present invention may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be employed. In other instances, well-known solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.

此外,附图仅为本发明的示意性图解,并非一定是按比例绘制。图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。附图中所示的一些方框图是功能实体,不一定必须与物理或逻辑上独立的实体相对应。可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。Furthermore, the drawings are merely schematic illustrations of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repeated descriptions will be omitted. Some of the block diagrams shown in the figures are functional entities that do not necessarily necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.

附图中所示的流程图仅是示例性说明,不是必须包括所有的步骤。例如,有的步骤还可以分解,而有的步骤可以合并或部分合并,因此实际执行的顺序有可能根据实际情况改变。The flow charts shown in the figures are merely illustrative and do not necessarily include all steps. For example, some steps can be decomposed, and some steps can be combined or partially combined, so the actual execution order may be changed according to the actual situation.

图1示意性示出了现有技术中一些方案的基于RabbitMQ模式的数据通信的方框图。数据通信的过程可以为:首先,消息生产端11可以将生产出的消息数据发送至消息队列服务器12中的消息交换机121;接下来,消息交换机121可以将消息数据发送至与其绑定的消息队列122、消息队列123、消息队列124或消息队列125;以消息数据发送至消息队列122为例,与消息队列122对应的消息消费端13可以通过其消息监听器131监听消息队列122,当消息数据发送至消息队列122时,消息监听器131可以监听到并获取该消息数据,并将该消息数据发送至消息消费端13内的消息处理应用(未示出)以便消息处理应用对该数据进行处理。由此,完成了基于RabbitMQ模式的数据通信过程。另外,包含有消息监听器141的消息消费端14可以与消息队列123对应,包含有消息监听器151的消息消费端15可以与消息队列124对应,以及包含消息监听器161的消息消费端16可以与消息队列125对应,它们具体的数据通信方式可以与消息队列122对应的通信方式相同,在此不再赘述。FIG. 1 schematically shows a block diagram of data communication based on RabbitMQ mode of some solutions in the prior art. The process of data communication can be: first, the message producer 11 can send the produced message data to the message exchange 121 in the message queue server 12; next, the message exchange 121 can send the message data to the message queue bound to it 122. The message queue 123, the message queue 124 or the message queue 125; taking the message data sent to the message queue 122 as an example, the message consumer 13 corresponding to the message queue 122 can monitor the message queue 122 through its message listener 131. When sending to the message queue 122, the message listener 131 can monitor and obtain the message data, and send the message data to the message processing application (not shown) in the message consumer 13 so that the message processing application can process the data . Thus, the data communication process based on the RabbitMQ mode is completed. In addition, the message consumer 14 including the message listener 141 may correspond to the message queue 123, the message consumer 15 including the message listener 151 may correspond to the message queue 124, and the message consumer 16 including the message listener 161 may Corresponding to the message queue 125, their specific data communication mode may be the same as the communication mode corresponding to the message queue 122, which will not be repeated here.

然而,这样的数据通信方式的缺点可能包括:一方面,如果一消息监听器宕机,则可能出现对应的消息队列数据堆积的问题,而开发人员或运维人员不能及时发现;另一方面,针对消息消费端,监听器与消息处理应用的耦合度较高,在对监听器或消息处理应用进行代码维护或在项目迭代时,开发人员修改某一处代码可能导致整个系统的错误,这不满足高内聚低耦合的设计要求。However, the disadvantages of such a data communication method may include: on the one hand, if a message listener goes down, the corresponding message queue data accumulation problem may occur, and developers or operation and maintenance personnel cannot find it in time; on the other hand, For the message consumer, the coupling between the listener and the message processing application is relatively high. During the code maintenance of the listener or the message processing application or when the project is iterated, the developer may modify a certain code, which may lead to errors in the entire system. Meet the design requirements of high cohesion and low coupling.

鉴于此,本发明提供了一种监听故障处理方法。In view of this, the present invention provides a monitoring fault processing method.

图2示意性示出了本发明的示例性实施方式的监听故障处理方法的流程图。该监听故障处理方法可以应用于包括消息队列和消息消费端的系统,参考图2,本发明的监听故障处理方法可以包括以下步骤:FIG. 2 schematically shows a flow chart of a method for processing a monitoring fault according to an exemplary embodiment of the present invention. The monitoring fault processing method can be applied to a system including a message queue and a message consumer. Referring to FIG. 2 , the monitoring fault processing method of the present invention may include the following steps:

S20.在所述消息消费端将消息监听器与消息处理应用解耦。S20. Decouple the message listener from the message processing application at the message consuming end.

在本发明的示例性实施方式中,消息消费端可以包括消息监听器和消息处理应用。其中,消息监听器可以用于监听与该消息消费端对应的消息队列,而消息处理应用可以是具体处理消息数据的应用,可以用于对数据进行加工、整合、展示等,本发明对消息处理应用的具体功能不做特殊限定。In an exemplary embodiment of the present invention, the message consumer may include a message listener and a message processing application. The message listener can be used to monitor the message queue corresponding to the message consumer, and the message processing application can be an application that specifically processes message data, and can be used to process, integrate, and display data. The specific functions of the application are not particularly limited.

根据本发明的一些实施例,具体解耦的方法可以例如包括:首先,可以对消息处理应用进行注册;接下来,用户可以在其客户端配置消息传输条件,具体的,用户可以通过消息处理应用对应的用户操作界面配置消息传输条件;随后,服务器可以根据消息传输条件将消息经由消息监听器发送至对应的消息处理应用。在上述消息传输过程中,可以采用RESTful架构实现消息监听器与消息处理应用之间的数据传输,具体的,消息传输条件可以被转化为与各模块兼容的RESTful数据,并且可以提供RESTful服务接口进行相应的传输服务。另外,可以基于RESTful的各类标记语言(例如,URI)进行数据分块整理,根据历史记录将数据进行分类,由此,不仅可以获得最大化的数据存储,也为筛选时提供更精确的导向。According to some embodiments of the present invention, the specific decoupling method may include, for example: first, the message processing application may be registered; next, the user may configure message transmission conditions on the client side. Specifically, the user may use the message processing application The corresponding user operation interface configures the message transmission conditions; then, the server can send the message to the corresponding message processing application via the message listener according to the message transmission conditions. In the above message transmission process, the RESTful architecture can be used to realize the data transmission between the message listener and the message processing application. Specifically, the message transmission conditions can be converted into RESTful data compatible with each module, and a RESTful service interface can be provided for the corresponding transport service. In addition, data can be sorted into chunks based on various RESTful markup languages (for example, URI), and data can be classified according to historical records, thereby not only maximizing data storage, but also providing more accurate guidance for screening. .

基于RESTful架构,可以实现无状态的面向资源的松耦合结构,无需考虑当前消息传输的状态,满足了消息监听器与消息处理应用的高内聚低耦合的设计目标。Based on the RESTful architecture, a stateless, resource-oriented, loosely coupled structure can be implemented without considering the current state of message transmission, which satisfies the design goal of high cohesion and low coupling between message listeners and message processing applications.

图3示意性示出了根据本发明的示例性实施方式的将消息监听器与消息处理应用解耦后的数据通信的方框图。首先,消息生产端31可以将其生产的消息发送至消息队列服务器32中的消息交换机321,另外,虽然图中未示出,然而应当理解的是,消息队列服务器32还可以包括其他消息交换机,并且本发明对消息交换机的数量不做特殊限定;随后,消息交换机321可以将消息发送至消息队列322、消息队列323、消息队列324或消息队列325,另外,类似地,消息队列服务器32中还可以包含其他消息队列和/或与消息交换机321对应的其他消息队列;接下来,以消息发送至消息队列322为例,消息消费端33中的消息监听器331监测到消息队列322接收有消息后,可以获取该消息。此外,一方面,消息消费端33中的消息监听器331可以将消息发送至与其解耦的消息处理应用332,以便消息处理应用332对该消息进行处理,此处解耦的优势在于,若修改消息监听器331的代码,则不会直接影响到消息处理应用332;另一方面,虽然图中未示出,消息消费端33中还可以包含其他与消息监听器331对应的消息处理应用。类似地,包含有消息监听器341和与其解耦的消息处理应用342的消息消费端34可以与消息队列323对应,包含有消息监听器351和与其解耦的消息处理应用352的消息消费端35可以与消息队列324对应,以及包含消息监听器361和与其解耦的消息处理应用362的消息消费端36可以与消息队列325对应,它们具体的数据通信方式与消息队列322对应的通信方式相同,在此不再赘述。FIG. 3 schematically shows a block diagram of data communication after decoupling a message listener from a message processing application according to an exemplary embodiment of the present invention. First, the message producer 31 can send the message produced by it to the message exchange 321 in the message queue server 32. In addition, although it is not shown in the figure, it should be understood that the message queue server 32 may also include other message exchanges, And the present invention does not limit the number of message exchanges; subsequently, the message exchange 321 can send the message to the message queue 322, the message queue 323, the message queue 324 or the message queue 325. In addition, similarly, the message queue server 32 also may include other message queues and/or other message queues corresponding to the message exchange 321; next, taking the message sent to the message queue 322 as an example, the message listener 331 in the message consumer 33 monitors that the message queue 322 receives a message after , you can get the message. In addition, on the one hand, the message listener 331 in the message consumer 33 can send the message to the message processing application 332 decoupled from it, so that the message processing application 332 can process the message. The code of the message listener 331 will not directly affect the message processing application 332; on the other hand, although not shown in the figure, the message consumer 33 may also include other message processing applications corresponding to the message listener 331. Similarly, the message consumer 34 including the message listener 341 and the message processing application 342 decoupled from it may correspond to the message queue 323, and the message consumer 35 including the message listener 351 and the message processing application 352 decoupled from it. It can correspond to the message queue 324, and the message consumer 36 including the message listener 361 and the message processing application 362 decoupled from it can correspond to the message queue 325, and their specific data communication mode is the same as the communication mode corresponding to the message queue 322, It is not repeated here.

此外,本发明可以采用其他架构实现消息监听器与消息消费端的解耦,例如,可以采用轻量级开源架构Spring来实现解耦等。应当理解的是,对消息消费端中消息监听器与消息处理应用进行解耦的方案均属于本发明的构思。In addition, other architectures can be used in the present invention to realize the decoupling of the message listener and the message consumer, for example, the lightweight open source architecture Spring can be used to realize the decoupling and so on. It should be understood that the solution of decoupling the message listener and the message processing application in the message consumer end belongs to the concept of the present invention.

通过将消息监听器与消息处理应用解耦,可以避免在进行代码维护或项目迭代时,由于修改某一处代码导致整个系统错误的问题,实现了高内聚低耦合的设计要求。By decoupling the message listener from the message processing application, it is possible to avoid the problem that the entire system is wrong due to modification of a certain code during code maintenance or project iteration, and achieves the design requirements of high cohesion and low coupling.

S22.对消息队列进行监测,如果监测出消息队列中存在异常消息队列,则通过预定通道将异常消息队列通知给消息消费端的监听管理器。S22. Monitor the message queue, and if it is detected that there is an abnormal message queue in the message queue, notify the monitoring manager of the message consumer end of the abnormal message queue through a predetermined channel.

在本发明的示例性实施方式中,可以在消息队列服务器中配置队列监测模块。首先,队列监测模块可以对各消息队列进行监测,具体的,队列监测模块监测的对象可以包括但不限于消息队列的长度,在这种情况下,对消息队列进行监测可以包括判断消息队列的长度是否异常;接下来,可以在消息消费端配置用于检测消息监听器的监听管理器。当队列监测模块监测出消息队列中存在异常消息队列时,可以将该异常消息队列通知给消息消费端的监听管理器。In an exemplary embodiment of the present invention, a queue monitoring module may be configured in the message queue server. First, the queue monitoring module can monitor each message queue. Specifically, the objects monitored by the queue monitoring module can include but are not limited to the length of the message queue. In this case, monitoring the message queue can include judging the length of the message queue. Is it abnormal? Next, you can configure a listener manager on the message consumer side to detect message listeners. When the queue monitoring module detects that there is an abnormal message queue in the message queue, it can notify the monitoring manager of the message consumer of the abnormal message queue.

例如,预先定义的消息队列的长度为1M,当队列监测模块监测出消息队列A的长度大于1M时,可以将消息队列A确定为异常消息队列并将消息队列A通知给监听管理器。For example, the length of the predefined message queue is 1M. When the queue monitoring module detects that the length of the message queue A is greater than 1M, it can determine the message queue A as an abnormal message queue and notify the monitoring manager of the message queue A.

根据本发明的一些实施例,队列监测模块可以通过预定通道将异常消息队列通知给监听管理器。具体的,预定通道可以是由HTTP协议搭建的传输通道,然而,预定通道还可以是采用RESTful接口进行通信的传输通道,然而,不限于此,本发明还可以采用其他通信方式实现队列监测模块与监听管理器之间的信息传输,本示例性实施方式中对此不做特殊限定。According to some embodiments of the present invention, the queue monitoring module may notify the monitoring manager of the abnormal message queue through a predetermined channel. Specifically, the predetermined channel may be a transmission channel constructed by the HTTP protocol, however, the predetermined channel may also be a transmission channel using a RESTful interface for communication, however, not limited to this, the present invention may also use other communication methods to realize the communication between the queue monitoring module and the queue monitoring module. The information transmission between monitoring managers is not specially limited in this exemplary embodiment.

S24.监听管理器确定与异常消息队列对应的消息监听器作为目标监听器。S24. The monitoring manager determines the message listener corresponding to the exception message queue as the target listener.

在本发明的示例性实施方式中,队列监测模块将异常消息队列通知给监听管理器后,监听管理器可以确定与该异常消息队列对应的消息监听器,并可以将该消息监听器作为目标监听器。In the exemplary embodiment of the present invention, after the queue monitoring module notifies the monitoring manager of the abnormal message queue, the monitoring manager can determine the message listener corresponding to the abnormal message queue, and can use the message listener as the target monitoring device.

根据本发明的一些实施例,消息监听器可以对应一个或多个消息队列。监听管理器可以基于配置的消息监听器与消息队列的对应关系确定出异常消息队列对应的消息监听器。例如,服务器可以存储有消息监听器与消息队列之间的对应关系表,可以通过查表的方式确定出异常消息队列对应的消息监听器。According to some embodiments of the present invention, a message listener may correspond to one or more message queues. The monitoring manager may determine the message listener corresponding to the abnormal message queue based on the corresponding relationship between the configured message listener and the message queue. For example, the server may store a correspondence table between message listeners and message queues, and may determine the message listener corresponding to the abnormal message queue by looking up the table.

S26.对目标监听器进行检测以便在检测出目标监听器故障的情况下重启所述目标监听器。S26. Detect the target listener so as to restart the target listener if a target listener failure is detected.

在确定出目标监听器后,可以对目标监听器的工作状态进行检测。具体的,如果检测出目标监听器故障,则重启目标监听器。其中,造成目标监听器故障的原因可能包含多方面,例如,软件故障、数据损坏、安全漏洞等。而这些故障可能会导致目标监听器宕机,进而导致消息队列长度异常。也就是说,目标监听器故障可能是消息队列出现异常的原因。After the target listener is determined, the working state of the target listener can be detected. Specifically, if a failure of the target listener is detected, the target listener is restarted. Among them, the reasons for the failure of the target listener may include various aspects, for example, software failure, data corruption, security loopholes, and the like. These failures may cause the target listener to go down, resulting in an abnormal message queue length. That is, a target listener failure may be the cause of an exception to the message queue.

另外,在监听管理器在检测出目标监听器时,也就是说,在监听管理器确定出与异常消息队列对应的消息监听器时,可以发送报警信号。例如,可以以短信或邮件的形式向开发人员或运维人员发送报警信息以便开发人员或运维人员获知异常消息队列的情况。In addition, when the monitoring manager detects the target listener, that is, when the monitoring manager determines the message listener corresponding to the abnormal message queue, an alarm signal can be sent. For example, alarm information can be sent to developers or operation and maintenance personnel in the form of text messages or emails so that the developers or operation and maintenance personnel can learn about the abnormal message queue.

下面将以图4所示数据通信为例对本发明的监听故障处理方法进行说明。The method for handling monitoring faults of the present invention will be described below by taking the data communication shown in FIG. 4 as an example.

一方面,消息生产端41可以将其生产的消息发送给消息队列服务器42中的消息交换机421,消息交换机421可以将接收到的消息数据发送至消息队列422、消息队列423、消息队列424、消息队列425、消息队列426或消息队列427。另外,队列检测模块4800可以实时监测消息队列422至427中是否存在长度异常的消息队列;另一方面,可以将消息消费端43中的消息监听器431与消息处理应用432和消息处理应用433解耦,另外,可以将消息消费端44中的消息监听器441与消息处理应用442和消息处理应用443解耦,可以将消息消费端45中的消息监听器451与消息处理应用452和消息处理应用453解耦。On the one hand, the message producer 41 can send the message produced by it to the message exchange 421 in the message queue server 42, and the message exchange 421 can send the received message data to the message queue 422, the message queue 423, the message queue 424, the message Queue 425, message queue 426 or message queue 427. In addition, the queue detection module 4800 can monitor in real time whether message queues with abnormal lengths exist in the message queues 422 to 427; In addition, the message listener 441 in the message consumer 44 can be decoupled from the message processing application 442 and the message processing application 443, and the message listener 451 in the message consumer 45 can be decoupled from the message processing application 452 and the message processing application. 453 Decoupling.

首先,以消息队列422长度异常为例,当队列监测模块4800监测出消息队列422异常时,可以通过RESTful接口4700将消息队列422通知给监听管理器4900;接下来,监听管理器4900可以确定出与消息队列422对应的消息监听器为消息监听器431,并对消息监听器431是否故障进行检测。如果检测出消息监听器431故障,则重启消息监听器431。First, taking the abnormal length of the message queue 422 as an example, when the queue monitoring module 4800 detects that the message queue 422 is abnormal, it can notify the monitoring manager 4900 of the message queue 422 through the RESTful interface 4700; then, the monitoring manager 4900 can determine the The message listener corresponding to the message queue 422 is the message listener 431, and whether the message listener 431 is faulty is detected. If the failure of the message listener 431 is detected, the message listener 431 is restarted.

从此过程可以看出,运用本发明的监听故障处理方法,整个过程无需人工参与,仅在发现消息监听器故障时可以向开发人员或运维人员发送报警信息,而发送报警信息仅为告知系统问题,并非需要人工对故障进行修复。本发明可以实现消息队列异常的自动修复过程,由此,缩短了人工参与而耽误的时间。It can be seen from this process that, using the monitoring fault processing method of the present invention, the whole process does not require manual participation, and only when a fault of the message listener is found, alarm information can be sent to developers or operation and maintenance personnel, and the alarm information is sent only to inform the system of problems. , does not require manual repair of the fault. The invention can realize the automatic repairing process of abnormal message queue, thereby shortening the time delayed by manual participation.

在本发明的示例性实施方式的监听故障处理方法中,通过将消息监听器与消息处理应用解耦,监测异常消息队列,并确定异常消息队列对应的监听器作为目标监听器,检测目标监听器并在目标监听器故障时重启目标监听器,一方面,通过自动重启监听器,可以解决监听器故障导致消息队列异常的问题而无需人工参与;另一方面,将消息监听器与消息处理应用解耦,可以避免在进行代码维护或项目迭代时,由于修改某一处代码导致整个系统错误的问题,实现了高内聚低耦合的设计要求。In the monitoring fault processing method of the exemplary embodiment of the present invention, the abnormal message queue is monitored by decoupling the message listener from the message processing application, and the listener corresponding to the abnormal message queue is determined as the target listener, and the target listener is detected. And restart the target listener when the target listener fails. On the one hand, by automatically restarting the listener, the problem of abnormal message queue caused by the listener failure can be solved without manual participation; Coupling can avoid the problem of errors in the entire system caused by modifying a certain code during code maintenance or project iteration, and achieves the design requirements of high cohesion and low coupling.

应当注意,尽管在附图中以特定顺序描述了本发明中方法的各个步骤,但是,这并非要求或者暗示必须按照该特定顺序来执行这些步骤,或是必须执行全部所示的步骤才能实现期望的结果。附加的或备选的,可以省略某些步骤,将多个步骤合并为一个步骤执行,以及/或者将一个步骤分解为多个步骤执行等。It should be noted that although the various steps of the methods of the present invention are depicted in the figures in a particular order, this does not require or imply that the steps must be performed in that particular order, or that all illustrated steps must be performed to achieve the desired the result of. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step for execution, and/or one step may be decomposed into multiple steps for execution, and the like.

进一步的,本示例实施方式中还提供了一种监听故障处理系统。Further, the present exemplary embodiment also provides a monitoring fault processing system.

图5示意性示出了本发明的示例性实施方式的监听故障处理系统的方框图。监听故障处理系统可以包括消息队列和消息消费端。参考图5,根据本发明的示例性实施方式的监听故障处理系统5可以包括解耦模块51、队列监测模块53和监听管理器55,其中:FIG. 5 schematically shows a block diagram of a listening fault processing system according to an exemplary embodiment of the present invention. The monitoring fault processing system may include a message queue and a message consumer. Referring to FIG. 5, a monitoring fault processing system 5 according to an exemplary embodiment of the present invention may include a decoupling module 51, a queue monitoring module 53 and a monitoring manager 55, wherein:

解耦模块51,可以用于在所述消息消费端将消息监听器与消息处理应用解耦;The decoupling module 51 can be used to decouple the message listener from the message processing application at the message consumer;

队列监测模块53,可以用于对所述消息队列进行监测,并在监测出所述消息队列中存在异常消息队列时,通过预定通道将所述异常消息队列通知给所述消息消费端的监听管理器;The queue monitoring module 53 can be used to monitor the message queue, and when an abnormal message queue is detected in the message queue, notify the abnormal message queue to the monitoring manager of the message consumer through a predetermined channel ;

监听管理器55,可以用于确定与所述异常消息队列对应的消息监听器作为目标监听器,对所述目标监听器进行检测以便在检测出所述目标监听器故障的情况下重启所述目标监听器。The monitoring manager 55 can be used to determine a message listener corresponding to the abnormal message queue as a target listener, and to detect the target listener so as to restart the target when a failure of the target listener is detected listener.

在本发明的示例性实施方式的监听故障处理系统中,一方面,通过自动重启监听器,可以解决监听器故障导致消息队列异常的问题而无需人工参与;另一方面,将消息监听器与消息处理应用解耦,可以避免在进行代码维护或项目迭代时,由于修改某一处代码导致整个系统错误的问题,实现了高内聚低耦合的设计要求。In the monitoring fault processing system of the exemplary embodiment of the present invention, on the one hand, by automatically restarting the listener, the problem of the abnormal message queue caused by the listener failure can be solved without manual participation; on the other hand, the message listener and the message Dealing with application decoupling can avoid the problem of errors in the entire system caused by modifying a certain code during code maintenance or project iteration, and achieves the design requirements of high cohesion and low coupling.

根据本发明的示例性实施例,参考图6,解耦模块51可以包括处理应用注册单元601、传输条件获取单元603和消息发送单元605,其中:According to an exemplary embodiment of the present invention, referring to FIG. 6 , the decoupling module 51 may include a processing application registration unit 601, a transmission condition obtaining unit 603 and a message sending unit 605, wherein:

处理应用注册单元601,可以用于对消息处理应用进行注册;A processing application registration unit 601, which can be used to register a message processing application;

传输条件获取单元603,可以用于获取来自消息处理应用的消息传输条件;A transmission condition acquisition unit 603, which can be used to acquire message transmission conditions from the message processing application;

消息发送单元605,可以用于根据消息传输条件将消息经由消息监听器发送至对应的消息处理应用。The message sending unit 605 may be configured to send the message to the corresponding message processing application via the message listener according to the message transmission condition.

本示例性实施例提供了一种实现消息监听器与消息处理应用解耦的方案。This exemplary embodiment provides a solution for decoupling a message listener from a message processing application.

根据本发明的示例性实施例,参考图7,监听故障处理系统7相对于监听故障处理系统5,除包括解耦模块51、队列监测模块53和监听管理器55外,还可以包括数据传输模块71,其中:According to an exemplary embodiment of the present invention, referring to FIG. 7 , compared to the monitoring fault processing system 5 , the monitoring fault processing system 7 may include a data transmission module in addition to the decoupling module 51 , the queue monitoring module 53 and the monitoring manager 55 71, of which:

数据传输模块71,可以用于采用RESTful架构实现消息监听器与消息处理应用之间的数据传输。The data transmission module 71 can be used to implement the data transmission between the message listener and the message processing application by adopting the RESTful architecture.

通过RESTful架构,可以实现无状态的资源松耦合,满足了消息监听器与消息处理应用的高内聚低耦合的设计目标。Through the RESTful architecture, stateless loose coupling of resources can be achieved, which satisfies the design goal of high cohesion and low coupling between message listeners and message processing applications.

根据本发明的示例性实施例,参考图8,队列监测模块53可以包括异常队列通知单元801,其中:According to an exemplary embodiment of the present invention, referring to FIG. 8 , the queue monitoring module 53 may include an exception queue notification unit 801, wherein:

异常队列通知单元801,可以用于在监测出消息队列中存在异常消息队列时,通过HTTP协议或RESTful接口将异常消息队列通知给消息消费端的监听管理器。The abnormal queue notification unit 801 can be configured to notify the monitoring manager of the message consumer end of the abnormal message queue through the HTTP protocol or the RESTful interface when it is detected that there is an abnormal message queue in the message queue.

通过HTTP协议或RESTful接口配置队列监测模块与监听管理器之间的信息通道,实现了基于队列监测模块的监测结果确定消息监听器故障的过程。The information channel between the queue monitoring module and the monitoring manager is configured through the HTTP protocol or the RESTful interface, and the process of determining the fault of the message listener based on the monitoring results of the queue monitoring module is realized.

根据本发明的示例性实施例,异常消息队列为队列长度异常的消息队列。参考图9,队列监测模块91相对于队列监测模块53,除包括异常队列通知单元801外,还可以包括长度异常判断单元901,其中:According to an exemplary embodiment of the present invention, the exception message queue is a message queue with an abnormal queue length. Referring to FIG. 9, the queue monitoring module 91, relative to the queue monitoring module 53, may include, in addition to the abnormal queue notification unit 801, a length abnormality judgment unit 901, wherein:

长度异常判断单元901,可以用于判断消息队列的长度是否异常。The length abnormality judging unit 901 can be used to judge whether the length of the message queue is abnormal.

根据本发明的示例性实施例,参考图10,监听管理器55可以包括监听单元1001,其中:According to an exemplary embodiment of the present invention, referring to FIG. 10 , the monitoring manager 55 may include a monitoring unit 1001, wherein:

监听单元1001,可以用于监听管理器根据消息监听器与消息队列之间的对应关系表确定与异常消息队列对应的消息监听器作为目标监听器。The monitoring unit 1001 can be used for the monitoring manager to determine the message listener corresponding to the abnormal message queue as the target listener according to the correspondence table between the message listener and the message queue.

通过查表的方式确定出目标监听器,过程简便,效率较高。The target listener is determined by looking up the table, the process is simple and the efficiency is high.

根据本发明的示例性实施例,参考图11,监听管理器111可以包括报警信号发送单元1101,其中:According to an exemplary embodiment of the present invention, referring to FIG. 11 , the monitoring manager 111 may include an alarm signal sending unit 1101, wherein:

报警信号发送单元1101,可以用于在检测出所述目标监听器故障的情况下,发送报警信号。The alarm signal sending unit 1101 may be configured to send an alarm signal when a fault of the target listener is detected.

通过发送报警信息,使得开发人员或运维人员可以获知目标监听器故障的情况。By sending alarm information, developers or operation and maintenance personnel can be informed of the failure of the target listener.

由于本发明实施方式的程序运行性能分析装置的各个功能模块与上述方法发明实施方式中相同,因此在此不再赘述。Since each functional module of the program running performance analysis apparatus in the embodiment of the present invention is the same as that in the above-mentioned method in the embodiment of the present invention, it will not be repeated here.

在本发明的示例性实施例中,还提供了一种计算机可读存储介质,其上存储有能够实现本说明书上述方法的程序产品。在一些可能的实施方式中,本发明的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当所述程序产品在终端设备上运行时,所述程序代码用于使所述终端设备执行本说明书上述“示例性方法”部分中描述的根据本发明各种示例性实施方式的步骤。In an exemplary embodiment of the present invention, there is also provided a computer-readable storage medium on which a program product capable of implementing the above-mentioned method of the present specification is stored. In some possible implementations, aspects of the present invention can also be implemented in the form of a program product comprising program code for enabling the program product to run on a terminal device The terminal device performs the steps according to various exemplary embodiments of the present invention described in the "Example Method" section above in this specification.

参考图12所示,描述了根据本发明的实施方式的用于实现上述方法的程序产品1200,其可以采用便携式紧凑盘只读存储器(CD-ROM)并包括程序代码,并可以在终端设备,例如个人电脑上运行。然而,本发明的程序产品不限于此,在本文件中,可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。Referring to FIG. 12, a program product 1200 for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read only memory (CD-ROM) and include program codes, and can be stored in a terminal device, For example running on a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

所述程序产品可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以为但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples (non-exhaustive list) of readable storage media include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可读程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。可读信号介质还可以是可读存储介质以外的任何可读介质,该可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。A computer readable signal medium may include a propagated data signal in baseband or as part of a carrier wave with readable program code embodied thereon. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A readable signal medium can also be any readable medium, other than a readable storage medium, that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.

可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于无线、有线、光缆、RF等等,或者上述的任意合适的组合。Program code embodied on a readable medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

可以以一种或多种程序设计语言的任意组合来编写用于执行本发明操作的程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、C++等,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。在涉及远程计算设备的情形中,远程计算设备可以通过任意种类的网络,包括局域网(LAN)或广域网(WAN),连接到用户计算设备,或者,可以连接到外部计算设备(例如利用因特网服务提供商来通过因特网连接)。Program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages—such as Java, C++, etc., as well as conventional procedural Programming Language - such as the "C" language or similar programming language. The program code may execute entirely on the user computing device, partly on the user device, as a stand-alone software package, partly on the user computing device and partly on a remote computing device, or entirely on the remote computing device or server execute on. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (eg, using an Internet service provider business via an Internet connection).

在本发明的示例性实施例中,还提供了一种能够实现上述方法的电子设备。In an exemplary embodiment of the present invention, an electronic device capable of implementing the above method is also provided.

所属技术领域的技术人员能够理解,本发明的各个方面可以实现为系统、方法或程序产品。因此,本发明的各个方面可以具体实现为以下形式,即:完全的硬件实施方式、完全的软件实施方式(包括固件、微代码等),或硬件和软件方面结合的实施方式,这里可以统称为“电路”、“模块”或“系统”。As will be appreciated by one skilled in the art, various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention can be embodied in the following forms: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, which may be collectively referred to herein as implementations "circuit", "module" or "system".

下面参照图13来描述根据本发明的这种实施方式的电子设备1300。图13显示的电子设备1300仅仅是一个示例,不应对本发明实施例的功能和使用范围带来任何限制。An electronic device 1300 according to this embodiment of the present invention is described below with reference to FIG. 13 . The electronic device 1300 shown in FIG. 13 is only an example, and should not impose any limitation on the function and scope of use of the embodiments of the present invention.

如图13所示,电子设备1300以通用计算设备的形式表现。电子设备1300的组件可以包括但不限于:上述至少一个处理单元1310、上述至少一个存储单元1320、连接不同系统组件(包括存储单元1320和处理单元1310)的总线1330、显示单元1340。As shown in FIG. 13, electronic device 1300 takes the form of a general-purpose computing device. Components of the electronic device 1300 may include, but are not limited to: the above-mentioned at least one processing unit 1310, the above-mentioned at least one storage unit 1320, a bus 1330 connecting different system components (including the storage unit 1320 and the processing unit 1310), and a display unit 1340.

其中,所述存储单元存储有程序代码,所述程序代码可以被所述处理单元1310执行,使得所述处理单元1310执行本说明书上述“示例性方法”部分中描述的根据本发明各种示例性实施方式的步骤。例如,所述处理单元1310可以执行如图2中所示的步骤S20:在消息消费端将消息监听器与消息处理应用解耦;步骤S22:对消息队列进行监测,如果监测出消息队列中存在异常消息队列,则通过预定通道将异常消息队列通知给消息消费端的监听管理器;步骤S24:监听管理器确定与异常消息队列对应的消息监听器作为目标监听器;步骤S26:对目标监听器进行检测以便在检测出目标监听器故障的情况下重启目标监听器。Wherein, the storage unit stores program codes, and the program codes can be executed by the processing unit 1310, so that the processing unit 1310 executes various exemplary methods according to the present invention described in the above-mentioned “Exemplary Methods” section of this specification Implementation steps. For example, the processing unit 1310 can perform step S20 as shown in FIG. 2 : decouple the message listener from the message processing application at the message consumer; step S22 : monitor the message queue, if it is detected that there is a message in the message queue abnormal message queue, the abnormal message queue is notified to the monitoring manager of the message consumer through a predetermined channel; step S24: the monitoring manager determines the message listener corresponding to the abnormal message queue as the target listener; step S26: the target listener is processed Check to restart the target listener if a target listener failure is detected.

存储单元1320可以包括易失性存储单元形式的可读介质,例如随机存取存储单元(RAM)13201和/或高速缓存存储单元13202,还可以进一步包括只读存储单元(ROM)13203。The storage unit 1320 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 13201 and/or a cache storage unit 13202 , and may further include a read only storage unit (ROM) 13203 .

存储单元1320还可以包括具有一组(至少一个)程序模块13205的程序/实用工具13204,这样的程序模块13205包括但不限于:操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。The storage unit 1320 may also include a program/utility 13204 having a set (at least one) of program modules 13205 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, An implementation of a network environment may be included in each or some combination of these examples.

总线1330可以为表示几类总线结构中的一种或多种,包括存储单元总线或者存储单元控制器、外围总线、图形加速端口、处理单元或者使用多种总线结构中的任意总线结构的局域总线。The bus 1330 may be representative of one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local area using any of a variety of bus structures bus.

电子设备1300也可以与一个或多个外部设备1500(例如键盘、指向设备、蓝牙设备等)通信,还可与一个或者多个使得用户能与该电子设备1300交互的设备通信,和/或与使得该电子设备1300能与一个或多个其它计算设备进行通信的任何设备(例如路由器、调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口1350进行。并且,电子设备1300还可以通过网络适配器1360与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。如图所示,网络适配器1360通过总线1330与电子设备1300的其它模块通信。应当明白,尽管图中未示出,可以结合电子设备1300使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。The electronic device 1300 may also communicate with one or more external devices 1500 (eg, keyboards, pointing devices, Bluetooth devices, etc.), with one or more devices that enable a user to interact with the electronic device 1300, and/or with Any device (eg, router, modem, etc.) that enables the electronic device 1300 to communicate with one or more other computing devices. Such communication may occur through input/output (I/O) interface 1350 . Also, the electronic device 1300 may communicate with one or more networks (eg, a local area network (LAN), a wide area network (WAN), and/or a public network such as the Internet) through a network adapter 1360 . As shown, network adapter 1360 communicates with other modules of electronic device 1300 via bus 1330. It should be appreciated that, although not shown, other hardware and/or software modules may be used in conjunction with electronic device 1300, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives and data backup storage systems.

通过以上的实施方式的描述,本领域的技术人员易于理解,这里描述的示例实施方式可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本发明实施方式的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、终端装置、或者网络设备等)执行根据本发明实施方式的方法。From the description of the above embodiments, those skilled in the art can easily understand that the exemplary embodiments described herein may be implemented by software, or may be implemented by software combined with necessary hardware. Therefore, the technical solutions according to the embodiments of the present invention can be embodied in the form of software products, and the software products can be stored in a non-volatile storage medium (which can be CD-ROM, U disk, mobile hard disk, etc.) or on the network , including several instructions to cause a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to an embodiment of the present invention.

此外,上述附图仅是根据本发明示例性实施例的方法所包括的处理的示意性说明,而不是限制目的。易于理解,上述附图所示的处理并不表明或限制这些处理的时间顺序。另外,也易于理解,这些处理可以是例如在多个模块中同步或异步执行的。Furthermore, the above-mentioned figures are merely schematic illustrations of the processes included in the methods according to the exemplary embodiments of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the chronological order of these processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, for example, in multiple modules.

应当注意,尽管在上文详细描述中提及了用于动作执行的设备的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本发明的实施方式,上文描述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化。反之,上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个模块或者单元来具体化。It should be noted that although several modules or units of the apparatus for action performance are mentioned in the above detailed description, this division is not mandatory. Indeed, according to embodiments of the present invention, the features and functions of two or more modules or units described above may be embodied in one module or unit. Conversely, the features and functions of one module or unit described above may be further divided into multiple modules or units to be embodied.

本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本发明的其他实施例。本申请旨在涵盖本发明的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本发明的一般性原理并包括本发明未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本发明的真正范围和精神由权利要求指出。Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the invention which follow the general principles of the invention and which include common knowledge or conventional techniques in the art not disclosed by the invention . The specification and examples are to be regarded as exemplary only, with the true scope and spirit of the invention being indicated by the claims.

应当理解的是,本发明并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本发明的范围仅由所附的权利要求来限。It should be understood that the present invention is not limited to the precise structures described above and illustrated in the accompanying drawings, and that various modifications and changes may be made without departing from its scope. The scope of the present invention is limited only by the appended claims.

Claims (9)

1. A monitoring fault processing method is applied to a system comprising a message queue and a message consumption end, and is characterized in that the monitoring fault processing method comprises the following steps:
at the message consumption end, a RESTful architecture is adopted to realize data transmission between the message listener and the message processing application so as to decouple the message listener and the message processing application; the message listener corresponds to one or more message queues;
monitoring the message queue, and if an abnormal message queue exists in the message queue, notifying the abnormal message queue to a monitoring manager of the message consumption end through a preset channel;
the monitoring manager determines a message monitor corresponding to the abnormal message queue as a target monitor;
detecting the target listener to restart the target listener if the target listener is detected as malfunctioning.
2. The snoop failure handling method of claim 1, wherein decoupling the message listener from the message processing application comprises:
registering a message processing application;
obtaining message transmission conditions from the message processing application;
and sending the message to the corresponding message processing application through the message listener according to the message transmission condition.
3. The snoop fault handling method according to claim 1, wherein notifying the snoop manager of the message consuming side of the exception message queue through a predetermined channel comprises:
and notifying the abnormal message queue to a monitoring manager of the message consumption end through an HTTP protocol or a RESTful interface.
4. The snoop fault handling method according to claim 1 or 3, wherein the exception message queue is a message queue with an exception queue length;
wherein monitoring the message queue comprises:
and judging whether the length of the message queue is abnormal or not.
5. The snoop fault handling method of claim 1, wherein said snoop manager determining a message listener corresponding to said exception message queue as a target listener comprises:
and the monitoring manager determines the message monitor corresponding to the abnormal message queue as a target monitor according to the corresponding relation table between the message monitors and the message queue.
6. The snoop fault handling method according to claim 1, wherein the snoop fault handling method further comprises:
and sending an alarm signal under the condition that the target monitor is detected to be in fault.
7. A monitoring fault processing system comprises a message queue and a message consumption end, and is characterized in that the monitoring fault processing system further comprises:
a decoupling module, configured to implement, at the message consumption end, data transmission between the message listener and the message processing application by using a RESTful architecture, so as to decouple the message listener from the message processing application; the message listener corresponds to one or more message queues;
the queue monitoring module is used for monitoring the message queue and notifying the abnormal message queue to a monitoring manager of the message consumption end through a preset channel when the abnormal message queue exists in the message queue;
and the monitoring manager is used for determining a message monitor corresponding to the abnormal message queue as a target monitor, and detecting the target monitor so as to restart the target monitor under the condition that the fault of the target monitor is detected.
8. A storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the snoop fault handling method of any of claims 1 to 6.
9. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the snoop fault handling method of any of claims 1-6 via execution of the executable instructions.
CN201711193568.XA 2017-11-24 2017-11-24 Monitoring failure processing method and device, storage medium and electronic device Active CN107896172B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711193568.XA CN107896172B (en) 2017-11-24 2017-11-24 Monitoring failure processing method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711193568.XA CN107896172B (en) 2017-11-24 2017-11-24 Monitoring failure processing method and device, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN107896172A CN107896172A (en) 2018-04-10
CN107896172B true CN107896172B (en) 2020-06-09

Family

ID=61804599

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711193568.XA Active CN107896172B (en) 2017-11-24 2017-11-24 Monitoring failure processing method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN107896172B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110224922B (en) * 2019-05-21 2022-04-19 成都路行通信息技术有限公司 Asynchronous message retry method, system and system construction method based on RabbitMQ
CN111782414B (en) * 2020-05-12 2024-04-19 北京皮尔布莱尼软件有限公司 Delay message processing method and system
CN111666170B (en) * 2020-05-29 2024-04-12 中国工商银行股份有限公司 Fault node processing method and device based on distributed framework
CN113806163A (en) * 2020-06-12 2021-12-17 航天信息股份有限公司 System monitoring method, device, equipment and storage medium
CN111600779B (en) * 2020-06-24 2022-03-04 厦门长江电子科技有限公司 A Test Platform Compatible with Various Switches
CN111930530B (en) * 2020-06-24 2024-04-30 浪潮通用软件有限公司 Equipment message processing method, device and medium based on Internet of things
CN115426209B (en) * 2022-11-07 2023-02-10 湖南三湘银行股份有限公司 High-reliability message queue broadcast control method based on message processing

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019866A (en) * 2012-10-24 2013-04-03 北京京东世纪贸易有限公司 Distributed method and system based on message queue
CN103064731A (en) * 2012-12-26 2013-04-24 人民搜索网络股份公司 Device and method for improving message queue system performance
CN105868033A (en) * 2016-04-06 2016-08-17 江苏物联网研究发展中心 Method and system for achieving priority message queues based on Redis

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8286189B2 (en) * 2007-09-27 2012-10-09 American Express Travel Related Services Company, Inc. System and method for automatically generating computer code for message flows

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019866A (en) * 2012-10-24 2013-04-03 北京京东世纪贸易有限公司 Distributed method and system based on message queue
CN103064731A (en) * 2012-12-26 2013-04-24 人民搜索网络股份公司 Device and method for improving message queue system performance
CN105868033A (en) * 2016-04-06 2016-08-17 江苏物联网研究发展中心 Method and system for achieving priority message queues based on Redis

Also Published As

Publication number Publication date
CN107896172A (en) 2018-04-10

Similar Documents

Publication Publication Date Title
CN107896172B (en) Monitoring failure processing method and device, storage medium and electronic device
US8612377B2 (en) Techniques for generating diagnostic results
US9292402B2 (en) Autonomous service management
US11789760B2 (en) Alerting, diagnosing, and transmitting computer issues to a technical resource in response to an indication of occurrence by an end user
US8805999B2 (en) Administering event reporting rules in a distributed processing system
US8171343B2 (en) Techniques for determining models for performing diagnostics
US9602337B2 (en) Event and alert analysis in a distributed processing system
JP2015511099A (en) Consistent detection of interconnect failures across the cluster
CN111190755B (en) Application program function exception handling method and device
CN110851471A (en) Distributed log data processing method, device and system
CN111476539A (en) Task monitoring method and device, computer equipment and storage medium
CN110727560A (en) Cloud service alarm method and device
US10289522B2 (en) Autonomous information technology diagnostic checks
CN111371898A (en) Message monitoring method, device, equipment and storage medium
CN109032867A (en) A kind of method for diagnosing faults, device and equipment
CN115037597A (en) Fault detection method and equipment
JP2011113122A (en) Failure influence analysis device, application system, and failure influence analysis method
CN110554929A (en) Data verification method and device, computer equipment and storage medium
US11271798B2 (en) Automated network link repair
CN112860504A (en) Monitoring method and device, computer storage medium and electronic equipment
WO2019241199A1 (en) System and method for predictive maintenance of networked devices
WO2020147415A1 (en) Snapshot service process management method and apparatus, electronic device, and readable storage medium
US10296967B1 (en) System, method, and computer program for aggregating fallouts in an ordering system
WO2025017703A1 (en) Method and system for achieving zero data loss in network failure scenarios
CN116701040A (en) Abnormal data processing method and device, electronic equipment and computer readable medium

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
GR01 Patent grant
GR01 Patent grant