The invention discloses a monitoring fault processing method, a device, a storage medium and an electronic device, which relates to the field of data communication technology. The monitoring system includes fault processing method is applied to the message queue and message consumer terminal, including the monitoring fault processing method: in the end consumer news message listener and message processing application decoupling; monitoring of message queue, if detected in the message queue exists abnormal message queue, the message queue will notify the predetermined channel abnormal listen to the message manager consumer end; monitor manager determines the message listener corresponding with the exception message queue as the target listener; were detected in order to detect the target listener fault case target listener to restart the listener. The invention can solve the problem of abnormal message queue due to the failure of the monitor, and achieve the design requirement of high cohesion and low coupling by decoupling the monitor and the message processing application.
【技术实现步骤摘要】
监听故障处理方法及装置、存储介质和电子设备
本专利技术涉及数据通信
,具体而言,涉及一种监听故障处理方法、监听故障处理装置、存储介质和电子设备。
技术介绍
随着社会信息化的发展,各业务系统之间的数据交互越来越频繁。目前,在各业务系统之间往往采用RabbitMQ(一种数据通信方法)来实现数据交互。具体的,首先,消息生产端(Producer)可以将消息发送至消息交换机(Exchange);随后,消息交换机可以将消息分发给各个与消息交换机绑定的队列(Queue);另外,消息消费端(Consumer)可以通过监听器(Monitor)对队列进行监听,并且在队列中的消息被消息消费端监听到并处理完之后,消息消费端可以反馈回叫(Callback)至队列;接下来,队列可以将当前消息清除。由此,当前数据交互处理结束。然而,一方面,目前存在由于监听器宕机等原因导致队列中消息长度堆积过高的问题;另一方面,针对消息消费端,监听器与具体处理消息的的消息处理应用的耦合度较高,在对监听器或消息处理应用进行代码维护或在项目迭代时,开发人员修改某一处代码可能导致整个系统的错误,这不满足高内聚低 ...
【技术保护点】
一种监听故障处理方法,应用于包括消息队列和消息消费端的系统,其特征在于,所述监听故障处理方法包括:在所述消息消费端将消息监听器与消息处理应用解耦;对所述消息队列进行监测,如果监测出所述消息队列中存在异常消息队列,则通过预定通道将所述异常消息队列通知给所述消息消费端的监听管理器;所述监听管理器确定与所述异常消息队列对应的消息监听器作为目标监听器;对所述目标监听器进行检测以便在检测出所述目标监听器故障的情况下重启所述目标监听器。
【技术特征摘要】
1.一种监听故障处理方法,应用于包括消息队列和消息消费端的系统,其特征在于,所述监听故障处理方法包括:在所述消息消费端将消息监听器与消息处理应用解耦;对所述消息队列进行监测,如果监测出所述消息队列中存在异常消息队列,则通过预定通道将所述异常消息队列通知给所述消息消费端的监听管理器;所述监听管理器确定与所述异常消息队列对应的消息监听器作为目标监听器;对所述目标监听器进行检测以便在检测出所述目标监听器故障的情况下重启所述目标监听器。2.根据权利要求1所述的监听故障处理方法,其特征在于,将消息监听器与消息处理应用解耦包括:对消息处理应用进行注册;获取来自所述消息处理应用的消息传输条件;根据消息传输条件将消息经由消息监听器发送至对应的消息处理应用。3.根据权利要求2所述的监听故障处理方法,其特征在于,所述监听故障处理方法还包括:采用RESTful架构实现消息监听器与消息处理应用之间的数据传输。4.根据权利要求1所述的监听故障处理方法,其特征在于,通过预定通道将所述异常消息队列通知给所述消息消费端的监听管理器包括:通过HTTP协议或RESTful接口将所述异常消息队列通知给所述消息消费端的监听管理器。5.根据权利要求1或4所述的监听故障处理方法,其特征在于,所述异常消息队列为队列长度异常的消息队列;其中,对所述消息队列进行监测包括:判断所述消息队...
【专利技术属性】
技术研发人员:张瑞庆,臧卓,
申请(专利权)人:泰康保险集团股份有限公司,
类型:发明
国别省市:北京,11
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。