CN108965457A - A kind of message delivery method of distributed cluster system, device, equipment and medium - Google Patents
A kind of message delivery method of distributed cluster system, device, equipment and medium Download PDFInfo
- Publication number
- CN108965457A CN108965457A CN201810870500.9A CN201810870500A CN108965457A CN 108965457 A CN108965457 A CN 108965457A CN 201810870500 A CN201810870500 A CN 201810870500A CN 108965457 A CN108965457 A CN 108965457A
- Authority
- CN
- China
- Prior art keywords
- message
- sent
- service application
- distributed cluster
- cluster system
- 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
Links
- 238000002716 delivery method Methods 0.000 title claims abstract description 22
- 238000000034 method Methods 0.000 claims abstract description 33
- 238000012545 processing Methods 0.000 claims abstract description 12
- 238000012790 confirmation Methods 0.000 claims description 25
- 230000005540 biological transmission Effects 0.000 claims description 13
- 238000004590 computer program Methods 0.000 claims description 4
- 230000008901 benefit Effects 0.000 claims description 3
- 238000010200 validation analysis Methods 0.000 claims 2
- 238000012546 transfer Methods 0.000 abstract description 10
- 230000008569 process Effects 0.000 abstract description 9
- 238000004891 communication Methods 0.000 abstract description 5
- 238000010586 diagram Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 7
- 230000008859 change Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000001131 transforming effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1097—Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/51—Discovery or management thereof, e.g. service location protocol [SLP] or web services
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
Abstract
本发明实施例公开了一种分布式集群系统的消息传递方法、装置、设备及计算机可读存储介质。其中,方法包括消息中间件获取第一业务应用的待发送消息,将其发送至第二业务应用,在发送完成之后将待发送消息的状态更改为已发送;然后在接收到第二业务应用反馈的消息确认信息之后,将待发送消息从中间件队列中删除。本申请基于消息中间件的信息传递,业务处理和消息的传递是异步进行,避免了对分布式集群系统业务操作的影响;通过信息发送的一致性和接收信息的一致性,保证信息传递过程中一致性,既能通过传递消息对分布式集群系统间的复杂调用进行解耦,降低系统的复杂性;也保证分布式集群系统间通信的可靠性,及业务操作与消息传递的一致性。
The embodiment of the invention discloses a message delivery method, device, equipment and computer-readable storage medium of a distributed cluster system. Wherein, the method includes that the message middleware acquires the message to be sent by the first business application, sends it to the second business application, changes the status of the message to be sent to sent after the sending is completed; and then receives the feedback from the second business application After confirming the message, the message to be sent is deleted from the middleware queue. This application is based on the information transfer of message middleware, and the business processing and message transfer are carried out asynchronously, which avoids the impact on the business operation of the distributed cluster system; through the consistency of information sending and receiving information, the process of information transfer is guaranteed Consistency can not only decouple complex calls between distributed cluster systems by passing messages, and reduce the complexity of the system; it also ensures the reliability of communication between distributed cluster systems and the consistency of business operations and message delivery.
Description
技术领域technical field
本发明实施例涉及分布式存储集群技术领域,特别是涉及一种分布式集群系统的消息传递方法、装置、设备及计算机可读存储介质。Embodiments of the present invention relate to the technical field of distributed storage clusters, and in particular, relate to a message delivery method, device, equipment, and computer-readable storage medium of a distributed cluster system.
背景技术Background technique
随着大数据、云计算的快速发展,分布式集群系统得到了快速的发展及广泛应用。With the rapid development of big data and cloud computing, distributed cluster systems have been rapidly developed and widely used.
分布式集群一般包含多个节点,这些节点统一对外提供服务,通常在集群中存在各个子系统,这些子系统基于高可用的要求,会部署在集群中的多个节点上。因此各子系统之间的相互调用也从单机调用转变为分布式集群系统的调用,基于一些业务需求,这些系统之间可能存在相互依赖以及相互调用。Distributed clusters generally contain multiple nodes, and these nodes provide external services in a unified manner. Usually, there are various subsystems in the cluster. These subsystems are deployed on multiple nodes in the cluster based on the requirements of high availability. Therefore, the mutual calls between subsystems have also changed from stand-alone calls to distributed cluster system calls. Based on some business requirements, there may be interdependence and mutual calls between these systems.
随着分布式集群系统处理的业务功能的逐渐丰富,分布式集群系统中包含的子系统数目也越来越多,各子系统间调用会变得很复杂。当相互依赖的其中一个子系统发生修改时,所有相关系统调用都需要进行修改。As the business functions handled by the distributed cluster system gradually enrich, the number of subsystems contained in the distributed cluster system is also increasing, and the calls between subsystems will become very complicated. When one of the interdependent subsystems is modified, all related system calls need to be modified.
消息中间件为利用高效可靠的消息传递机制进行平台无关的数据交流,并基于数据通信来进行分布式集群系统的集成。通过提供消息传递和消息排队模型,在分布式环境下扩展进程间的通信,例如目前使用比较广泛的RabbitMQ,ActiveMQ等。Message middleware uses efficient and reliable message delivery mechanism for platform-independent data exchange, and integrates distributed cluster systems based on data communication. By providing message passing and message queuing models, the communication between processes is extended in a distributed environment, such as RabbitMQ, ActiveMQ, etc., which are widely used at present.
现有技术中,通常会引入消息中间件来对系统间的相互调用进行解耦,各个子系统通过消息中间件进行消息的发送与接收,将系统间的直接调用转变为基于消息传递的异步调用。In the existing technology, message middleware is usually introduced to decouple the mutual calls between systems, and each subsystem sends and receives messages through message middleware, transforming direct calls between systems into asynchronous calls based on message passing .
但是,跨节点的消息传递,可能会由于网络等原因出现丢失,因此通过消息中间件进行消息的发送与接收,会存在不一致的可能。可见,如何在分布式集群系统中使用消息中间件进行消息传递时,保证消息传递的一致性,是本领域技术人员亟待解决的问题。However, cross-node message transmission may be lost due to network and other reasons, so there may be inconsistencies in sending and receiving messages through message middleware. It can be seen that how to ensure the consistency of message delivery when using message middleware in a distributed cluster system is an urgent problem to be solved by those skilled in the art.
发明内容Contents of the invention
本发明实施例的目的是提供一种分布式集群系统的消息传递方法、装置、设备及计算机可读存储介质,基于消息中间件在分布式集群系统中进行消息传递,既完成了分布式集群系统中各子系统间的解耦,又可保证消息传递的可靠性、及业务操作和消息传递的一致性。The purpose of the embodiments of the present invention is to provide a message delivery method, device, equipment and computer-readable storage medium of a distributed cluster system, and to perform message delivery in a distributed cluster system based on message middleware, which not only completes the distributed cluster system The decoupling between subsystems in the system can also ensure the reliability of message delivery and the consistency of business operations and message delivery.
为解决上述技术问题,本发明实施例提供以下技术方案:In order to solve the above technical problems, embodiments of the present invention provide the following technical solutions:
本发明实施例一方面提供了一种分布式集群系统的消息传递方法,基于消息中间件,包括:On the one hand, an embodiment of the present invention provides a message delivery method for a distributed cluster system, based on message middleware, including:
获取第一业务应用的待发送消息,将其发送至第二业务应用,并将所述待发送消息的状态更改为已发送;Acquiring the message to be sent by the first service application, sending it to the second service application, and changing the status of the message to be sent to sent;
获取所述第二业务应用反馈的消息确认信息,将所述待发送消息从中间件队列中删除。Obtain message confirmation information fed back by the second service application, and delete the message to be sent from the middleware queue.
可选的,所述获取第一业务应用的待发送消息包括:Optionally, the acquiring the message to be sent of the first service application includes:
按照预设频率查询所述第一业务应用的第一消息表,获取所述第一消息表中的待发送消息。Querying the first message table of the first service application according to a preset frequency to obtain messages to be sent in the first message table.
可选的,所述获取所述第二业务应用反馈的消息确认信息包括:Optionally, the acquiring the message confirmation information fed back by the second service application includes:
判断在预设时长内是否收到所述第二业务应用反馈的消息确认信息;judging whether the message confirmation information fed back by the second service application is received within a preset time period;
若否,则将所述待发送消息再次发送给所述第二业务应用,直至接收到所述第二业务应用反馈的消息确认信息。If not, the to-be-sent message is sent to the second service application again until the message confirmation information fed back by the second service application is received.
本发明实施例另一方面提供了一种分布式集群系统的消息传递装置,基于消息中间件,包括:Another aspect of the embodiment of the present invention provides a message delivery device for a distributed cluster system, based on message middleware, including:
信息发送模块,用于获取第一业务应用的待发送消息,将其发送至第二业务应用,并将所述待发送消息的状态更改为已发送;An information sending module, configured to obtain a message to be sent by the first service application, send it to the second service application, and change the status of the message to be sent to sent;
信息确认接收模块,用于获取所述第二业务应用反馈的消息确认信息,将所述待发送消息从中间件队列中删除。The information confirmation receiving module is configured to obtain the message confirmation information fed back by the second service application, and delete the message to be sent from the middleware queue.
可选的,所述信息发送模块为按照预设频率查询所述第一业务应用的第一消息表,获取所述第一消息表中的待发送消息的模块。Optionally, the information sending module is a module that inquires the first message table of the first service application according to a preset frequency, and acquires messages to be sent in the first message table.
可选的,所述信息确认接收模块包括:Optionally, the information confirmation receiving module includes:
判断子模块,用于判断在预设时长内是否收到所述第二业务应用反馈的消息确认信息;A judging submodule, configured to judge whether the message confirmation information fed back by the second service application is received within a preset time period;
再次发送子模块,用于在预设时长内没有收到所述第二业务应用反馈的消息确认信息,则将所述待发送消息再次发送给所述第二业务应用,直至接收到所述第二业务应用反馈的消息确认信息。The re-sending submodule is configured to resend the message to be sent to the second service application if the message confirmation information fed back by the second service application is not received within a preset period of time until the second service application is received. 2. Message confirmation information fed back by the business application.
本发明实施例还提供了一种分布式集群系统的消息传递设备,包括处理器,所述处理器用于执行存储器中存储的计算机程序时实现如前任一项所述分布式集群系统的消息传递方法的步骤。The embodiment of the present invention also provides a message delivery device of a distributed cluster system, including a processor, and the processor is used to implement the message delivery method of the distributed cluster system as described in any one of the preceding items when executing the computer program stored in the memory A step of.
本发明实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有分布式集群系统的消息传递程序,所述分布式集群系统的消息传递程序被处理器执行时实现如前任一项所述分布式集群系统的消息传递方法的步骤。The embodiment of the present invention also provides a computer-readable storage medium, the message delivery program of the distributed cluster system is stored on the computer-readable storage medium, and the message delivery program of the distributed cluster system is implemented when executed by the processor. The steps of the message delivery method of the distributed cluster system as described in any one of the preceding items.
本发明实施例还提供了一种分布式集群系统的消息传递方法,基于第一业务应用,包括:The embodiment of the present invention also provides a message delivery method of a distributed cluster system, based on the first business application, including:
在执行业务操作时,通过本地事务,在第一消息表中写入消息,所述消息的状态为待发送;When executing a business operation, a message is written in the first message table through a local transaction, and the status of the message is to be sent;
将所述消息发送至消息中间件,以使所述消息中间件将所述消息发送至第二业务应用,并在完成发送后将所述消息的状态更改为已发送。Sending the message to the message middleware, so that the message middleware sends the message to the second service application, and changes the state of the message to sent after the sending is completed.
本发明实施例最后还提供了一种分布式集群系统的消息传递方法,基于第二业务应用,包括:Finally, the embodiment of the present invention also provides a message delivery method of a distributed cluster system, based on the second business application, including:
当接收到消息中间件发送的消息,根据所述消息的哈希值,在第二消息表中查找是否已处理过所述消息;When receiving the message sent by the message middleware, according to the hash value of the message, check whether the message has been processed in the second message table;
若已处理,则向所述消息中间件发送所述消息的处理结果;If it has been processed, send the processing result of the message to the message middleware;
若未处理,则根据所述消息携带的信息执行对应的业务操作处理,并向所述消息中间件反馈消息确认信息;当执行业务操作完成后,将所述消息及相对应的哈希值保存至所述第二消息表中。If it is not processed, execute the corresponding business operation processing according to the information carried in the message, and feed back the message confirmation information to the message middleware; when the execution of the business operation is completed, save the message and the corresponding hash value to the second message table.
本发明实施例提供了一种分布式集群系统的消息传递方法,消息中间件获取第一业务应用的待发送消息,将其发送至第二业务应用,在发送完成之后将待发送消息的状态更改为已发送;然后在接收到第二业务应用反馈的消息确认信息之后,将待发送消息从中间件队列中删除。本申请提供的技术方案的优点在于,基于消息中间件的信息传递,业务处理和消息的传递是异步进行,从而避免了对分布式集群系统业务操作的影响,将分布式集群系统间调用从远程调用转变为基于消息传递的方式,对各子系统进行了解耦;通过信息发送的一致性和接收信息的一致性,保证信息传递过程中一致性,既能通过传递消息对分布式集群系统间的复杂调用进行解耦,降低分布式集群系统的复杂性;也保证分布式集群系统间通信的可靠性,及业务操作与消息传递的一致性。An embodiment of the present invention provides a message delivery method for a distributed cluster system. The message middleware acquires the message to be sent by the first business application, sends it to the second service application, and changes the state of the message to be sent after the sending is completed. is sent; then, after receiving the message confirmation information fed back by the second business application, the message to be sent is deleted from the middleware queue. The advantage of the technical solution provided by this application is that, based on the information transfer of the message middleware, business processing and message transfer are performed asynchronously, thus avoiding the impact on the business operation of the distributed cluster system, and transferring calls between distributed cluster systems from remote The call is transformed into a message-based method to decouple each subsystem; through the consistency of information sending and receiving information, the consistency in the process of information transmission can be guaranteed, and the distributed cluster system can be connected by sending messages. Decoupling complex calls to reduce the complexity of the distributed cluster system; also to ensure the reliability of communication between distributed cluster systems, and the consistency of business operations and message delivery.
此外,本发明实施例还针对分布式集群系统的消息传递方法提供了相应的实现装置、设备及计算机可读存储介质,进一步使得所述方法更具有实用性,所述装置、设备及计算机可读存储介质具有相应的优点。In addition, the embodiments of the present invention also provide corresponding implementation devices, devices, and computer-readable storage media for the message delivery method of the distributed cluster system, which further makes the method more practical. The device, device, and computer-readable The storage medium has corresponding advantages.
附图说明Description of drawings
为了更清楚的说明本发明实施例或现有技术的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单的介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only For some embodiments of the present invention, those skilled in the art can also obtain other drawings based on these drawings without creative work.
图1为本发明实施例提供的一种分布式集群系统的消息传递方法的交互流程示意图;FIG. 1 is a schematic diagram of an interaction process of a message delivery method of a distributed cluster system provided by an embodiment of the present invention;
图2为本发明实施例提供的分布式集群系统的消息传递装置的一种具体实施方式结构图;FIG. 2 is a structural diagram of a specific implementation manner of a message transfer device of a distributed cluster system provided by an embodiment of the present invention;
图3为本发明实施例提供的分布式集群系统的消息传递装置的另一种具体实施方式结构图;FIG. 3 is a structural diagram of another specific implementation manner of the message transfer device of the distributed cluster system provided by the embodiment of the present invention;
图4为本发明实施例提供的分布式集群系统的消息传递装置的再一种具体实施方式结构图。FIG. 4 is a structural diagram of yet another specific implementation manner of the message delivery device of the distributed cluster system provided by the embodiment of the present invention.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本发明方案,下面结合附图和具体实施方式对本发明作进一步的详细说明。显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to enable those skilled in the art to better understand the solution of the present invention, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. Apparently, the described embodiments are only some of the embodiments of the present invention, but not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”“第四”等是用于区别不同的对象,而不是用于描述特定的顺序。此外术语“包括”和“具有”以及他们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可包括没有列出的步骤或单元。The terms "first", "second", "third" and "fourth" in the specification and claims of this application and the above drawings are used to distinguish different objects, rather than to describe a specific order . Furthermore, the terms "comprising" and "having", and any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, product, or device comprising a series of steps or units is not limited to the listed steps or units, but may include unlisted steps or units.
在介绍了本发明实施例的技术方案后,下面详细的说明本申请的各种非限制性实施方式。After introducing the technical solutions of the embodiments of the present invention, various non-limiting implementations of the present application will be described in detail below.
首先参见图1,图1为本发明实施例提供的一种分布式集群系统的消息传递方法的交互流程示意图,本发明实施例可包括以下内容:First, referring to FIG. 1, FIG. 1 is a schematic diagram of an interactive flow diagram of a message delivery method of a distributed cluster system provided by an embodiment of the present invention. The embodiment of the present invention may include the following:
S101:第一业务应用在执行业务操作时,通过本地事务,在第一消息表中写入消息,该消息的状态为待发送状态。S101: When performing a business operation, the first business application writes a message in the first message table through a local transaction, and the state of the message is a state to be sent.
第一消息表用于存储第一业务应用的消息,第一业务应用可将执行业务操作时需要发送的消息,通过本地事务写入在第一消息表中,在消息中间件未读取消息时,第一消息表中的信息的状态为待发送状态。The first message table is used to store the messages of the first business application. The first business application can write the messages that need to be sent when performing business operations into the first message table through local transactions. When the message middleware does not read the messages , the state of the information in the first message table is the state to be sent.
S102:第一业务应用在完成业务操作后,向消息中间件发送将该消息发送至第二业务应用的请求指令。S102: After completing the service operation, the first service application sends a request instruction to the message middleware for sending the message to the second service application.
S103:消息中间件获取第一业务应用在第一消息表中的待发送消息,将其发送至第二业务应用,并将待发送消息的状态更改为已发送。S103: The message middleware obtains the message to be sent by the first service application in the first message table, sends it to the second service application, and changes the status of the message to be sent to sent.
S104:第二业务应用接收到消息中间件发送的消息,根据该消息的哈希值,在第二消息表中查找是否已处理过该消息,若是,则执行S105;若否,则执行S106。S104: The second service application receives the message sent by the message middleware, and checks whether the message has been processed in the second message table according to the hash value of the message, and if yes, executes S105; if not, executes S106.
第二消息表为用于存储第二业务应用的消息。The second message table is used to store messages of the second service application.
至于如何获取消息的哈希值、以及根据哈希值从第二消息表中查询该信息,均可参见现有技术,此处,便不在赘述。As for how to obtain the hash value of the message and query the information from the second message table according to the hash value, reference may be made to the prior art, and details will not be repeated here.
S105:第二业务应用向消息中间件发送消息的处理结果。S105: The second service application sends a processing result of the message to the message middleware.
处理结果可为已对该消息进行了处理的结果,或者是已完成,以使消息中间件明确第二业务应用已收到第一业务应用发送给其的消息。The processing result may be the result that the message has been processed, or it has been completed, so that the message middleware knows that the second service application has received the message sent to it by the first service application.
S106:第二业务应用根据消息携带的信息执行对应的业务操作处理,并向消息中间件反馈消息确认信息。S106: The second service application performs corresponding service operation processing according to the information carried in the message, and feeds back message confirmation information to the message middleware.
第一业务应用在向第二业务应用发送消息时,消息中会携带第一业务应用的相关地址信息、第二业务应用的相关地址信息、第二业务应用需要执行的业务操作等,以使第二业务应用明确其要执行的任务。When the first service application sends a message to the second service application, the message will carry relevant address information of the first service application, relevant address information of the second service application, business operations to be performed by the second service application, etc., so that the second service application 2. The business application defines the tasks to be performed.
S107:第二业务应用执行业务操作完成后,将消息及相对应的哈希值保存至第二消息表中。S107: After the second service application executes the service operation, save the message and the corresponding hash value in the second message table.
S108:消息中间件获取第二业务应用反馈的消息确认信息,并将该消息从中间件队列中删除。S108: The message middleware acquires the message confirmation information fed back by the second service application, and deletes the message from the middleware queue.
在本发明实施例提供的技术方案中,基于消息中间件的信息传递,业务处理和消息的传递是异步进行,从而避免了对分布式集群系统业务操作的影响,将分布式集群系统间调用从远程调用转变为基于消息传递的方式,对各子系统进行了解耦;通过信息发送的一致性和接收信息的一致性,保证信息传递过程中一致性,既能通过传递消息对分布式集群系统间的复杂调用进行解耦,降低分布式集群系统的复杂性;也保证分布式集群系统间通信的可靠性,及业务操作与消息传递的一致性。In the technical solution provided by the embodiment of the present invention, based on the information transfer of the message middleware, the business processing and the message transfer are carried out asynchronously, thereby avoiding the impact on the business operation of the distributed cluster system, and the inter-distributed cluster system call from The remote call is transformed into a message-based method to decouple each subsystem; through the consistency of information sending and receiving information, the consistency in the process of information transmission can be guaranteed, and the distributed cluster system can be updated by passing messages. Decoupling the complex calls between distributed cluster systems reduces the complexity of distributed cluster systems; it also ensures the reliability of communication between distributed cluster systems and the consistency of business operations and message delivery.
基于上述实施例,为了进一步保证信息发送的一致性,本申请还可在消息中间件增加一个轮询线程,该轮询线程可按照一定的频率(例如每隔1分钟)定时查询第一消息表,及时查询第一消息表中状态为待发送的消息,将因为网络等原因没有成功发送的消息,再次进行发送操作,同样,完成发送后,将消息状态更改为“已发送”。Based on the above-mentioned embodiments, in order to further ensure the consistency of information transmission, the present application can also add a polling thread to the message middleware, and the polling thread can regularly query the first message table according to a certain frequency (for example, every 1 minute). , timely query the messages whose status is to be sent in the first message table, and send the messages that have not been successfully sent due to network and other reasons, and perform the sending operation again. Similarly, after the sending is completed, change the status of the message to "sent".
而为了进一步保证信息接收的一致性,本申请还可包括:In order to further ensure the consistency of information reception, this application may also include:
消息中间件判断在预设时长内(例如5min)是否收到第二业务应用反馈的消息确认信息;The message middleware judges whether the message confirmation information fed back by the second business application is received within a preset period of time (for example, 5 minutes);
若否,则将待发送消息再次发送给第二业务应用,直至接收到第二业务应用反馈的消息确认信息。If not, the message to be sent is sent to the second service application again until the message confirmation information fed back by the second service application is received.
当然,如果消息中间件连续多次(可根据实际应用场景设置阈值,例如5次)向第二业务应用发送消息,但均未接收到第二业务应用反馈的确认信息,此时,系统可能出现其他问题,可向相关人员进行反馈,以使相关工作人员及时排查问题发生的原因并及时进行维护,提高整个系统的工作效率,进一步保证信息的发送和接收的一致性。Of course, if the message middleware sends messages to the second business application multiple times in succession (threshold can be set according to the actual application scenario, for example, 5 times), but no confirmation information fed back by the second business application is received, at this time, the system may appear For other problems, you can give feedback to the relevant personnel, so that the relevant staff can promptly investigate the cause of the problem and perform maintenance in a timely manner, improve the work efficiency of the entire system, and further ensure the consistency of information sending and receiving.
本发明实施例还针对分布式集群系统的消息传递方法提供了相应的实现装置,进一步使得所述方法更具有实用性。下面对本发明实施例提供的分布式集群系统的消息传递装置进行介绍,下文描述的分布式集群系统的消息传递装置与上文描述的分布式集群系统的消息传递方法可相互对应参照。The embodiment of the present invention also provides a corresponding implementation device for the message delivery method of the distributed cluster system, which further makes the method more practical. The message delivery device of the distributed cluster system provided by the embodiment of the present invention is introduced below. The message delivery device of the distributed cluster system described below and the message delivery method of the distributed cluster system described above can be referred to in correspondence.
参见图2,图2为本发明实施例提供的分布式集群系统的消息传递装置在一种具体实施方式下的结构图,该装置可包括:Referring to FIG. 2, FIG. 2 is a structural diagram of a message delivery device of a distributed cluster system provided in an embodiment of the present invention in a specific implementation manner, and the device may include:
信息发送模块201,用于获取第一业务应用的待发送消息,将其发送至第二业务应用,并将待发送消息的状态更改为已发送;The information sending module 201 is used to obtain the message to be sent by the first service application, send it to the second service application, and change the status of the message to be sent to sent;
信息确认接收模块202,用于获取第二业务应用反馈的消息确认信息,将待发送消息从中间件队列中删除。The information confirmation receiving module 202 is configured to obtain the message confirmation information fed back by the second service application, and delete the message to be sent from the middleware queue.
可选的,在一种具体的实施方式中,所述信息发送模块201还可为按照预设频率查询第一业务应用的第一消息表,获取第一业务应用中的待发送消息的模块。Optionally, in a specific implementation manner, the information sending module 201 may also be a module that inquires the first message table of the first service application at a preset frequency to obtain messages to be sent in the first service application.
在另外一种实施方式中,所述信息确认接收模块202还可包括:In another implementation manner, the information confirmation receiving module 202 may further include:
判断子模块,用于判断在预设时长内是否收到第二业务应用反馈的消息确认信息;The judging sub-module is used to judge whether the message confirmation information fed back by the second business application is received within the preset time period;
再次发送子模块,用于在预设时长内没有收到第二业务应用反馈的消息确认信息,则将待发送消息再次发送给第二业务应用,直至接收到第二业务应用反馈的消息确认信息。The re-sending sub-module is used to resend the message to be sent to the second service application if the message confirmation information fed back by the second service application is not received within the preset time period, until the message confirmation information fed back by the second service application is received .
此外,请参阅图3所示,本申请还提供了另外一种具体实施方式下的分布式集群系统的消息传递装置,具体可包括:In addition, please refer to FIG. 3 , the present application also provides another message delivery device for a distributed cluster system in a specific implementation manner, which may specifically include:
消息写入模块301,用于在执行业务操作时,通过本地事务,在第一消息表中写入消息,消息的状态为待发送;The message writing module 301 is used to write a message in the first message table through a local transaction when performing a business operation, and the status of the message is to be sent;
消息发送模块302,用于将消息发送至消息中间件,以使消息中间件将消息发送至第二业务应用,并在完成发送后将消息的状态更改为已发送。The message sending module 302 is configured to send the message to the message middleware, so that the message middleware sends the message to the second service application, and changes the state of the message to sent after the sending is completed.
最后,请参阅图4所所示,本申请还提供了另外一种具体实施方式下的分布式集群系统的消息传递装置,具体可包括:Finally, as shown in FIG. 4 , this application also provides another message delivery device for a distributed cluster system in a specific implementation manner, which may specifically include:
信息查找模块401,用于当接收到消息中间件发送的消息,根据消息的哈希值,在第二消息表中查找是否已处理过所述消息;The information search module 401 is used to search whether the message has been processed in the second message table according to the hash value of the message when receiving the message sent by the message middleware;
反馈结果模块402,用于当已处理该消息时,则向所述消息中间件发送所述消息的处理结果;Feedback result module 402, configured to send the processing result of the message to the message middleware when the message has been processed;
消息处理模块403,用于当已处理该消息时,则根据消息携带的信息执行对应的业务操作处理,并向消息中间件反馈消息确认信息;The message processing module 403 is configured to perform corresponding business operation processing according to the information carried in the message when the message has been processed, and feed back message confirmation information to the message middleware;
消息存储模块404,用于当执行业务操作完成后,将消息及相对应的哈希值保存至所述第二消息表中。The message storage module 404 is configured to store the message and the corresponding hash value in the second message table after the execution of the service operation is completed.
本发明实施例所述分布式集群系统的消息传递装置的各功能模块的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。The functions of each functional module of the message delivery device of the distributed cluster system described in the embodiment of the present invention can be specifically implemented according to the method in the above method embodiment, and the specific implementation process can refer to the relevant description of the above method embodiment, and will not be repeated here repeat.
由上可知,本发明实施例基于消息中间件在分布式集群系统中进行消息传递,既完成了分布式集群系统中各子系统间的解耦,又可保证消息传递的可靠性、及业务操作和消息传递的一致性。It can be seen from the above that the embodiment of the present invention performs message transmission in the distributed cluster system based on message middleware, which not only completes the decoupling between subsystems in the distributed cluster system, but also ensures the reliability of message transmission and business operations and messaging consistency.
本发明实施例还提供了一种分布式集群系统的消息传递设备,具体可包括:The embodiment of the present invention also provides a message delivery device for a distributed cluster system, which may specifically include:
存储器,用于存储计算机程序;memory for storing computer programs;
处理器,用于执行计算机程序以实现如上任意一实施例所述分布式集群系统的消息传递方法的步骤。A processor, configured to execute a computer program to implement the steps of the message delivery method for a distributed cluster system as described in any one of the above embodiments.
本发明实施例所述分布式集群系统的消息传递设备的各功能模块的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。The functions of each functional module of the message delivery device of the distributed cluster system described in the embodiment of the present invention can be specifically implemented according to the method in the above method embodiment, and the specific implementation process can refer to the relevant description of the above method embodiment, which will not be repeated here repeat.
由上可知,本发明实施例基于消息中间件在分布式集群系统中进行消息传递,既完成了分布式集群系统中各子系统间的解耦,又可保证消息传递的可靠性、及业务操作和消息传递的一致性。It can be seen from the above that the embodiment of the present invention performs message transmission in the distributed cluster system based on message middleware, which not only completes the decoupling between subsystems in the distributed cluster system, but also ensures the reliability of message transmission and business operations and messaging consistency.
本发明实施例还提供了一种计算机可读存储介质,存储有分布式集群系统的消息传递程序,所述分布式集群系统的消息传递程序被处理器执行时如上任意一实施例所述分布式集群系统的消息传递方法的步骤。The embodiment of the present invention also provides a computer-readable storage medium, which stores the message delivery program of the distributed cluster system. When the message delivery program of the distributed cluster system is executed by the processor, the distributed Steps of a message passing method for a cluster system.
本发明实施例所述计算机可读存储介质的各功能模块的功能可根据上述方法实施例中的方法具体实现,其具体实现过程可以参照上述方法实施例的相关描述,此处不再赘述。The functions of each functional module of the computer-readable storage medium in the embodiments of the present invention can be specifically implemented according to the methods in the above-mentioned method embodiments, and the specific implementation process can refer to the relevant descriptions of the above-mentioned method embodiments, which will not be repeated here.
由上可知,本发明实施例基于消息中间件在分布式集群系统中进行消息传递,既完成了分布式集群系统中各子系统间的解耦,又可保证消息传递的可靠性、及业务操作和消息传递的一致性。It can be seen from the above that the embodiment of the present invention performs message transmission in the distributed cluster system based on message middleware, which not only completes the decoupling between subsystems in the distributed cluster system, but also ensures the reliability of message transmission and business operations and messaging consistency.
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其它实施例的不同之处,各个实施例之间相同或相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。Each embodiment in this specification is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same or similar parts of each embodiment can be referred to each other. As for the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and for the related information, please refer to the description of the method part.
专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Professionals can further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software or a combination of the two. In order to clearly illustrate the possible For interchangeability, in the above description, the composition and steps of each example have been generally described according to their functions. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present invention.
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of the methods or algorithms described in connection with the embodiments disclosed herein may be directly implemented by hardware, software modules executed by a processor, or a combination of both. Software modules can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other Any other known storage medium.
以上对本发明所提供的一种分布式集群系统的消息传递方法、装置、设备及计算机可读存储介质进行了详细介绍。本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想。应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以对本发明进行若干改进和修饰,这些改进和修饰也落入本发明权利要求的保护范围内。The message transfer method, device, equipment and computer-readable storage medium of a distributed cluster system provided by the present invention have been introduced in detail above. In this paper, specific examples are used to illustrate the principle and implementation of the present invention, and the descriptions of the above embodiments are only used to help understand the method and core idea of the present invention. It should be pointed out that for those skilled in the art, without departing from the principle of the present invention, some improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810870500.9A CN108965457A (en) | 2018-08-02 | 2018-08-02 | A kind of message delivery method of distributed cluster system, device, equipment and medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810870500.9A CN108965457A (en) | 2018-08-02 | 2018-08-02 | A kind of message delivery method of distributed cluster system, device, equipment and medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN108965457A true CN108965457A (en) | 2018-12-07 |
Family
ID=64466843
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201810870500.9A Pending CN108965457A (en) | 2018-08-02 | 2018-08-02 | A kind of message delivery method of distributed cluster system, device, equipment and medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN108965457A (en) |
Cited By (16)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110287046A (en) * | 2019-07-03 | 2019-09-27 | 浪潮云信息技术有限公司 | Business service message method and system based on queue |
| CN110413424A (en) * | 2019-07-24 | 2019-11-05 | 深圳乐信软件技术有限公司 | Configurable third-party message callback method, device, server and storage medium |
| CN110413425A (en) * | 2019-07-24 | 2019-11-05 | 深圳乐信软件技术有限公司 | Third-party message callback method, device, server and storage medium |
| CN110505315A (en) * | 2019-09-27 | 2019-11-26 | 北京锐安科技有限公司 | Data processing method, device, equipment and storage medium |
| CN110941622A (en) * | 2019-10-31 | 2020-03-31 | 京东数字科技控股有限公司 | Data processing method and device |
| CN111127088A (en) * | 2019-12-17 | 2020-05-08 | 深圳前海环融联易信息科技服务有限公司 | Method, device, computer equipment and storage medium for realizing final consistency |
| CN111190766A (en) * | 2019-12-12 | 2020-05-22 | 北京淇瑀信息科技有限公司 | HBase database-based cross-machine-room cluster disaster recovery method, device and system |
| CN111666162A (en) * | 2020-04-30 | 2020-09-15 | 平安科技(深圳)有限公司 | Distributed message transmission method, device, computer equipment and storage medium |
| CN111679892A (en) * | 2020-06-04 | 2020-09-18 | 中国建设银行股份有限公司 | Distributed transaction processing method, device, equipment and medium |
| CN111970091A (en) * | 2020-08-06 | 2020-11-20 | 北京浪潮数据技术有限公司 | Communication method, system, equipment and computer readable storage medium |
| CN112749193A (en) * | 2019-10-31 | 2021-05-04 | 北京京东尚科信息技术有限公司 | Workflow processing method and device, storage medium and electronic equipment |
| CN112799891A (en) * | 2021-01-15 | 2021-05-14 | 网易(杭州)网络有限公司 | iOS device test method, device, system, storage medium and computer device |
| CN113094362A (en) * | 2021-04-30 | 2021-07-09 | 中国银行股份有限公司 | Method and device for reliably delivering and processing asynchronous message |
| CN113760566A (en) * | 2020-11-10 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Method, device, system and storage medium for distributed transaction processing |
| CN115185569A (en) * | 2022-07-12 | 2022-10-14 | 上海得帆信息技术有限公司 | A plug-in hot update method and system in a distributed environment |
| CN115834663A (en) * | 2022-11-29 | 2023-03-21 | 中国建设银行股份有限公司 | Message processing method, device, equipment and medium |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20140059215A1 (en) * | 2012-08-22 | 2014-02-27 | Oracle International Corporation | System and method for ensuring internet protocol (ip) address and node name consistency in a middleware machine environment |
| CN105242975A (en) * | 2015-08-27 | 2016-01-13 | 浪潮软件股份有限公司 | Message transmission method and message middleware |
| CN106254445A (en) * | 2016-07-29 | 2016-12-21 | 深圳前海微众银行股份有限公司 | Message sending method and server |
| CN106874076A (en) * | 2017-01-21 | 2017-06-20 | 浙江沛宏网络科技有限公司 | Distributed transaction processing method |
| CN107332906A (en) * | 2017-06-30 | 2017-11-07 | 郑州云海信息技术有限公司 | Distributed system office management method and device |
-
2018
- 2018-08-02 CN CN201810870500.9A patent/CN108965457A/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20140059215A1 (en) * | 2012-08-22 | 2014-02-27 | Oracle International Corporation | System and method for ensuring internet protocol (ip) address and node name consistency in a middleware machine environment |
| CN105242975A (en) * | 2015-08-27 | 2016-01-13 | 浪潮软件股份有限公司 | Message transmission method and message middleware |
| CN106254445A (en) * | 2016-07-29 | 2016-12-21 | 深圳前海微众银行股份有限公司 | Message sending method and server |
| CN106874076A (en) * | 2017-01-21 | 2017-06-20 | 浙江沛宏网络科技有限公司 | Distributed transaction processing method |
| CN107332906A (en) * | 2017-06-30 | 2017-11-07 | 郑州云海信息技术有限公司 | Distributed system office management method and device |
Cited By (18)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110287046A (en) * | 2019-07-03 | 2019-09-27 | 浪潮云信息技术有限公司 | Business service message method and system based on queue |
| CN110413424A (en) * | 2019-07-24 | 2019-11-05 | 深圳乐信软件技术有限公司 | Configurable third-party message callback method, device, server and storage medium |
| CN110413425A (en) * | 2019-07-24 | 2019-11-05 | 深圳乐信软件技术有限公司 | Third-party message callback method, device, server and storage medium |
| CN110413424B (en) * | 2019-07-24 | 2021-12-10 | 深圳乐信软件技术有限公司 | Configurable third-party message callback method, device, server and storage medium |
| CN110505315A (en) * | 2019-09-27 | 2019-11-26 | 北京锐安科技有限公司 | Data processing method, device, equipment and storage medium |
| CN112749193A (en) * | 2019-10-31 | 2021-05-04 | 北京京东尚科信息技术有限公司 | Workflow processing method and device, storage medium and electronic equipment |
| CN110941622A (en) * | 2019-10-31 | 2020-03-31 | 京东数字科技控股有限公司 | Data processing method and device |
| CN111190766A (en) * | 2019-12-12 | 2020-05-22 | 北京淇瑀信息科技有限公司 | HBase database-based cross-machine-room cluster disaster recovery method, device and system |
| CN111127088A (en) * | 2019-12-17 | 2020-05-08 | 深圳前海环融联易信息科技服务有限公司 | Method, device, computer equipment and storage medium for realizing final consistency |
| CN111666162A (en) * | 2020-04-30 | 2020-09-15 | 平安科技(深圳)有限公司 | Distributed message transmission method, device, computer equipment and storage medium |
| CN111679892A (en) * | 2020-06-04 | 2020-09-18 | 中国建设银行股份有限公司 | Distributed transaction processing method, device, equipment and medium |
| CN111970091A (en) * | 2020-08-06 | 2020-11-20 | 北京浪潮数据技术有限公司 | Communication method, system, equipment and computer readable storage medium |
| CN113760566A (en) * | 2020-11-10 | 2021-12-07 | 北京沃东天骏信息技术有限公司 | Method, device, system and storage medium for distributed transaction processing |
| CN112799891A (en) * | 2021-01-15 | 2021-05-14 | 网易(杭州)网络有限公司 | iOS device test method, device, system, storage medium and computer device |
| CN113094362A (en) * | 2021-04-30 | 2021-07-09 | 中国银行股份有限公司 | Method and device for reliably delivering and processing asynchronous message |
| CN113094362B (en) * | 2021-04-30 | 2024-04-16 | 中国银行股份有限公司 | Method and device for reliably delivering and processing asynchronous message |
| CN115185569A (en) * | 2022-07-12 | 2022-10-14 | 上海得帆信息技术有限公司 | A plug-in hot update method and system in a distributed environment |
| CN115834663A (en) * | 2022-11-29 | 2023-03-21 | 中国建设银行股份有限公司 | Message processing method, device, equipment and medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN108965457A (en) | A kind of message delivery method of distributed cluster system, device, equipment and medium | |
| CN112788074B (en) | Data sending method, processing method, receiving method and its device, storage medium | |
| CN108536532B (en) | Batch task processing method and system | |
| CN112667414A (en) | Message queue-based message consumption method and device, computer equipment and medium | |
| CN108874558B (en) | Message subscription method of distributed transaction, electronic device and readable storage medium | |
| CN111274052A (en) | Data distribution method, server, and computer-readable storage medium | |
| CN110688828A (en) | File processing method and device, file processing system and computer equipment | |
| CN101176068B (en) | Apparatus, system, and method for facilitating communication between an enterprise information system and a customer | |
| CN108008950B (en) | Method and device for realizing user interface updating | |
| CN114363407A (en) | Message service method and apparatus, readable storage medium and electronic device | |
| CN111796946A (en) | Data processing method, device, equipment and storage medium | |
| CN111090532A (en) | Application service calling method and device, electronic equipment and computer storage medium | |
| CN105959346A (en) | Data processing system and data processing method based on server cluster | |
| CN113014618A (en) | Message processing method and system and electronic equipment | |
| CN108664520A (en) | Safeguard method, apparatus, electronic equipment and the readable storage medium storing program for executing of data consistency | |
| CN111679892A (en) | Distributed transaction processing method, device, equipment and medium | |
| CN114327948A (en) | Message processing method, apparatus, device and storage medium | |
| CN116382943A (en) | Sequential message processing method, bus system, computer device, and storage medium | |
| US20090271466A1 (en) | Data logging with network interfacing feature | |
| CN113947434B (en) | A business processing method and device for a multi-business component combination scenario | |
| CN115617480A (en) | Task scheduling method, device and system and storage medium | |
| JPWO2008105099A1 (en) | Application cooperation control program, application cooperation control method, and application cooperation control apparatus | |
| CN118689618A (en) | Task processing method, device, equipment, readable storage medium and program product | |
| CN113849320A (en) | Development method, control method and computing device | |
| CN113064905A (en) | Business process 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 | ||
| RJ01 | Rejection of invention patent application after publication | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20181207 |