CN117762652A - Distributed transaction processing method and device based on message middleware - Google Patents

Distributed transaction processing method and device based on message middleware Download PDF

Info

Publication number
CN117762652A
CN117762652A CN202311749267.6A CN202311749267A CN117762652A CN 117762652 A CN117762652 A CN 117762652A CN 202311749267 A CN202311749267 A CN 202311749267A CN 117762652 A CN117762652 A CN 117762652A
Authority
CN
China
Prior art keywords
processing
message middleware
sending
message
result
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311749267.6A
Other languages
Chinese (zh)
Inventor
黄进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Leelen Technology Co Ltd
Original Assignee
Xiamen Leelen Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen Leelen Technology Co Ltd filed Critical Xiamen Leelen Technology Co Ltd
Priority to CN202311749267.6A priority Critical patent/CN117762652A/en
Publication of CN117762652A publication Critical patent/CN117762652A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The application provides a method and a device for processing distributed transactions based on message middleware, and relates to the field of transaction processing, wherein the method comprises the following steps: the sending end processes the processing request of the target event to obtain a processing success result, and sends the processing success result to the message middleware; the message middleware sends the acquired successful processing result to the consumer; if the consumption terminal receives the successful processing result, a target response is sent to the message middleware; and if the message middleware does not receive the target response, executing the step of sending the acquired successful processing result to the consumer side according to the configured retry strategy. The method can ensure the reliability and consistency of the transmission of the message and the data in the processing process of the sending end and the consumption end through the message middleware, and improve the response rate of the request.

Description

Distributed transaction processing method and device based on message middleware
Technical Field
The present invention relates to the field of transaction processing, and in particular, to a method and apparatus for processing a distributed transaction based on message middleware.
Background
In the distributed situation, the application system has a remarkable problem in communication, namely, a service flow often needs to be combined into a group of services, and single communication can pass through devices such as a DNS service, a network card, a switch, a router, load balancing and the like, but the corresponding devices are not always stable, and in the whole process of data transmission, the situation that data transmission is stopped can be caused as long as any link goes wrong.
This is more evident in micro services, where for example a service is made up of a plurality of micro service logics, since some micro services are abnormal, but other micro services are normal, so that data consistency cannot be guaranteed.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method and an apparatus for processing a distributed transaction based on a message middleware, so as to solve the problem that data consistency cannot be guaranteed in the prior art.
In a first aspect, a method for processing a distributed transaction based on message middleware is provided, where the method may include:
the sending end processes the processing request of the target event to obtain a processing success result, and sends the processing success result to the message middleware;
the message middleware sends the acquired successful processing result to the consumption end;
if the consumption end receives the processing success result, the consumption end sends a target response to the message middleware;
and if the message middleware does not receive the target response, executing the step of sending the acquired successful processing result to the consumer terminal according to the configured retry strategy.
In one possible implementation, after sending the target information including the processing success to the message middleware, the method further includes:
the message middleware sends a first response to the sending terminal when receiving the processing success result;
when the sending end does not receive the first response sent by the message middleware, the sending end re-executes the step of sending a successful processing result to the message middleware;
and after the step of transmitting the successful processing result to the message middleware at least once is re-executed by the transmitting end, and the first response transmitted by the message middleware is not received, executing rollback operation.
In a possible implementation, after the step of sending the obtained successful processing result to the consumer end according to a configured retry strategy, the method further includes:
and if the target response is not received in the message middle, the message middle sends a rollback indication identifier to the sending end, and generates prompt information of rollback operation so that the sending end executes the rollback operation.
In one possible implementation, the processing system further comprises a visualization unit;
and the visualization unit receives the prompt information of the rollback operation sent by the sending end and displays the prompt information.
In one possible implementation, the processing system further includes cache middleware;
the cache middleware identifies the processing states of the sending end, the consumption end and the message middleware for the target event, wherein the processing states of the sending end comprise executed, unexecuted and rolled back; the processing state of the consumer includes retried and rolled back.
In one possible implementation, the retry strategy includes an interval retry, an immediate retry, and a combined retry.
In one possible implementation, the interval retries include a fixed interval retry, an incremental interval retry, and an exponentially increasing interval retry.
In a second aspect, a processing apparatus for message middleware-based distributed transactions is provided, the apparatus may include:
the processing module is used for processing the processing request of the target event by the sending end to obtain a processing success result and sending the processing success result to the message middleware;
the sending module is used for sending the acquired successful processing result to the consumption end by the message middleware;
if the consumption end receives the processing success result, the consumption end sends a target response to the message middleware;
and the execution module is used for executing the step of sending the acquired successful processing result to the consumption terminal according to the configured retry strategy if the message middleware does not receive the target response.
In a third aspect, an electronic device is provided, the electronic device comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory are in communication with each other via the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of the above first aspects when executing a program stored on a memory.
In a fourth aspect, a computer-readable storage medium is provided, in which a computer program is stored which, when being executed by a processor, carries out the method steps of any of the first aspects.
The application provides a processing method of a distributed transaction based on message middleware, which comprises the following steps: the sending end processes the processing request of the target event to obtain a processing success result, and sends the processing success result to the message middleware; the message middleware sends the acquired successful processing result to the consumer; if the consumption terminal receives the successful processing result, a target response is sent to the message middleware; and if the message middleware does not receive the target response, executing the step of sending the acquired successful processing result to the consumer side according to the configured retry strategy. The method can ensure the reliability and consistency of the transmission of the message and the data in the processing process of the sending end and the consumption end through the message middleware, and improve the response rate of the request.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a system architecture diagram of a method for processing a distributed transaction applied to message middleware according to an embodiment of the present application;
fig. 2 is a flow chart of a method for processing a distributed transaction based on message middleware according to an embodiment of the present application;
FIG. 3 is a first timing diagram of a method for processing a distributed transaction based on message middleware according to an embodiment of the present application;
FIG. 4 is a second timing diagram of a method for processing a distributed transaction based on message middleware according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a processing device for a distributed transaction based on message middleware according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments of the present application without making any inventive effort, are intended to be within the scope of the present application.
The method for processing the distributed transaction based on the message middleware provided in the embodiment of the application can be applied to a system architecture shown in fig. 1, and as shown in fig. 1, the system can include: a server and a terminal of a message middleware based distributed transaction processing system. The server may be a physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), basic cloud computing services such as big data and artificial intelligent platforms. The Terminal may be a Mobile phone, a smart phone, a notebook computer, a digital broadcast receiver, a Personal Digital Assistant (PDA), a tablet personal computer (PAD), or other User Equipment (UE), a handheld device, a car-mounted device, a wearable device, a computing device, or other processing device connected to a wireless modem, a Mobile Station (MS), a Mobile Terminal (Mobile Terminal), or the like. The terminal and the server may be directly or indirectly connected through wired or wireless communication, which is not limited herein.
And the terminal is used for acquiring the processing request of the target event and sending the processing request to the server. The processing request may be divided into a plurality of processing stages according to the actual situation, for example, the plurality of processing stages of which the target event is a device deletion event may include disconnecting a device, deleting device information, and deleting a cache file of the device. At this time, we can consider the device deletion event as a link information including a plurality of processing stages for performing compensation processing according to the compensation mechanism when an abnormality occurs in processing the corresponding processing request later.
And the server is used for acquiring the processing request comprising the target event so as to execute the processing method of the distributed transaction based on the message middleware.
The processing system of the distributed transaction based on the message middleware comprises a service unit, the message middleware, a cache middleware and a visualization unit, wherein the service unit comprises a sending end and a consuming end.
For ease of understanding, the terms referred to in the embodiments of the present application are explained below:
message middleware is a supportive software system for providing asynchronous and reliable message transmission for application systems in a network environment based on queue and message transfer technology, and utilizes an efficient and reliable message transfer mechanism for platform-independent data communication and for integration of a distributed system based on data communication. By providing a messaging and message queuing model, it can extend inter-process communication in a distributed environment.
Rollback operation: it can be understood that after executing a certain event, the state is restored to the state before executing the certain event, so that the consistency of the data inside and outside the system is ensured. For example: after the user has emptied all data, the contents of the database are written to disk.
Because the application system has a remarkable problem in the distributed situation when in communication, namely, one service flow often needs to be combined into a group of services, and single communication can pass through devices such as DNS service, network card, switch, router, load balancing and the like, the corresponding devices are not always stable, and in the whole process of data transmission, the situation that data transmission is stopped can be caused as long as any link goes wrong.
Therefore, the present application proposes a method for processing a distributed transaction based on message middleware, so as to solve the above problem, and finally keep relevant data consistent through a compensation mechanism, so as to improve accuracy and consistency of data transmission and response efficiency of a request.
The preferred embodiments of the present application will be described below with reference to the accompanying drawings of the specification, it being understood that the preferred embodiments described herein are for illustration and explanation only, and are not intended to limit the present application, and embodiments and features of embodiments of the present application may be combined with each other without conflict.
Fig. 2 is a flow chart of a method for processing a distributed transaction based on message middleware according to an embodiment of the present application. As shown in fig. 2, the method may include:
step S210, the sending end processes the processing request of the target event to obtain a processing result.
Specifically, a processor sends a processing request including a target event of a multi-processing stage to a service unit of a server through a terminal, determines a sending end of a current processing stage of the processing request, and then when the sending end confirms that the processing state of the processing request in the current processing stage is not executed, the sending end indicates that the current processing stage does not perform any processing in a history process, and processes the processing request to obtain a processing result;
when the processing result is a processing failure result, the sending end automatically reprocesses the processing request of the target event, and if the processing times reach the preset times and the processing result is still the processing failure result, prompt information requiring manual intervention is sent.
As shown in fig. 3, when the processing result is a processing success result, the processing success result is sent to the message middleware.
At this time, the processing state of the sender by the caching middleware is recorded as executed, and the caching middleware can record link Information (ID) and the processing state through the redis caching service.
Step S220, the sender determines whether the message middleware obtains a successful processing result.
As shown in fig. 3 and fig. 4, the message middleware sends a first response to the sending end when receiving a successful processing result.
That is, when the transmitting end does not receive the first reply transmitted by the message middleware, the transmitting end performs a step of transmitting a result of processing success to the message middleware (retry operation). The processing state of the sending end by the cache middleware is recorded as retried, and in some embodiments, the sending end can execute a retry operation according to a retry strategy.
And if the sending end re-executes at least one step of sending the successful processing result to the message middleware and does not receive the first response sent by the message middleware, executing rollback operation. The processing state of the cache middleware to the sending end is recorded as rolled back. And generating prompt information of the rollback operation, and sending the prompt information of the rollback operation to the visualization unit.
And the visualization unit receives the prompt information of the rollback operation and displays the prompt information. The visual unit provided by the mode can prompt related personnel in time when equipment hardware or failure which cannot be recovered in a short time such as network cable breakage occurs, and the target event needs to be manually intervened and repaired.
When the sending end receives the first response, the message middleware is judged to receive the successful processing result. And then, sending the successful processing result to the consumer end in the current processing stage.
Step S230, the message middle determines whether the consumer obtains a successful processing result.
Specifically, when the consumer receives the successful processing result, the consumer sends a target response to the message middleware.
If the message middle receives the target response, the message middle indicates that the consumer receives a successful processing result, at this time, the consumer executes own processing logic for the current processing stage of the target event according to the successful processing result, and after the execution is completed, the caching middleware marks the processing state of the target event in the current processing stage of the consumer as executed; in some embodiments, there is a subsequent processing stage after the current processing stage, and then the consuming end at this time is used as the sending end of the subsequent processing stage to execute the method provided in the present application.
If the target response is not received in the middle of the message, the fact that the consumption end does not receive the successful processing result is indicated, and the successful processing result is sent to the consumption end in the current processing stage according to the configured retry strategy.
The retry strategy may include, among other things, interval retries, immediate retries, and combined retries.
Further, interval retries include fixed interval retries, incremental interval retries, and exponentially increasing interval retries.
Retry immediately: it will be appreciated that the failure to receive a successful result of a process is caused by a temporary failure, and may in particular be due to network packet collisions or hardware component peak traffic events, in which case an immediate retry operation is appropriate. However, the operation of the immediate retry generally does not exceed once, and if the immediate retry fails, other retry strategies are employed instead.
Interval retry: it is understood that the successful processing result is retransmitted to the consumer at certain time intervals, that is, the retry operation is performed at certain time intervals.
Retry at fixed intervals: it is understood that the retry operation is performed every n minutes.
Incremental interval retry: the time interval increment for each retry operation is incremented. For example, the successful processing result is sent to the consumer for multiple times according to the first time of 0 seconds, the second time of 5 seconds and the third time of 10 seconds. And the retry operation result is that the more the number of failures is, the more the retry request priority is arranged behind, and the new incoming retry request is given way.
Retrying at an exponential incrementing interval: the time interval for each retry operation increases exponentially.
The combined retry can be understood as increasing randomness based on retrying the exponential increase interval, and replacing the exponential part with incremental increase; or, a combined retry is determined between the exponential incrementing interval retry and the manner in which the exponential portion is replaced with an incremental increase. This method is suitable for a scenario in which a large number of retry requests generated at a certain time are distributed under pressure.
This approach can guarantee the reliability of data transmission through message middleware.
Then, the message middleware detects whether a target response is received;
and when the message middleware receives the target response, indicating that the consumer receives a successful processing result after the retry operation, determining the next processing stage of the current processing stage as a new current processing stage according to the processing sequence of each processing stage of the processing request of the target event, determining the transmitting end of the new current processing stage, and returning to the execution step S210.
And when the message middleware does not receive the target response, the rollback indication identifier is sent to the sending end so that the sending end executes rollback operation, and at the moment, the processing state of the current processing stage of the target event recorded by the caching middleware is rollback. And if the processing state of the current processing stage is rollback, generating operation information comprising rollback indication marks, and sending the operation information to the historical processing stage. The history processing stage is a completed processing stage before the current processing stage, and meanwhile, the prompting information of the rollback operation is generated and sent to the visualization unit, and the visualization unit receives the prompting information of the rollback operation and displays the prompting information.
In some embodiments, the caching middleware stores and identifies the processing state of the current processing stage to prevent flooding of other operations of each processing stage during the retry operation, thereby ensuring that the data ultimately remains consistent in the event of concurrent execution. In short, for the same link information, only unique operation can be performed at the same time in each processing stage, so as to ensure the accuracy of data.
In the present application, a global link ID is generated for multiple processing stages of a target event processing request, which may be understood as an ID of a target event, and is used to track the entire target event.
For example, the target event is a process of deleting a device, and the process of deleting the device without an abnormality may include: the sending terminal sends the message of successful deleting equipment to the message middleware, and the message middleware receives the message and sends the message to the consumption terminal; the consumer receives the message and the consumer executes its own processing logic for the delete device.
The process of deleting the presence anomaly in the device process may include: the sending end sends the successful message of the deleting equipment to the message middleware, when the message middleware does not receive the message, the sending end performs retry operation (resends the message to the message middleware), if the retry fails, the sending end performs rollback operation on the deleting equipment in the current processing stage and notifies each processing stage to perform rollback operation, and the caching middleware records the processing state of the consuming end as rollback; if the retry is successful, i.e. the message middleware receives the message, the step of sending the message to the consumer is continued. When the consumer receives the message, inquiring the processing state of the link information corresponding to the message in the history time, and if the rollback exists, directly ending the deleting equipment flow without executing own processing logic for deleting equipment. If the rollback does not exist and the processing state at the consumer is not executed, the consumer executes its own processing logic for deleting the device.
In some embodiments, when executing its processing logic for the removing device, if an exception occurs, the consumer may also execute a retry operation according to the retry policy, and after the retry operation fails, may perform a rollback operation, and display, through the visualization unit, a hint information of the rollback operation.
The target event is a process of deleting equipment, a plurality of processing stages in the service unit are required to be called, the plurality of service processing stages can comprise equipment management service, home service and grouping service, and the equipment management service can delete the processing stages of equipment information; the home service may be a processing stage of deleting the device connected to the specific scene; the group service may be a processing stage of deleting the relationship between each house and the device. The communication among the service stages is asynchronously decoupled through the message middleware, if any service abnormality exists, the service data is inconsistent, and the following points can be finally achieved by using the method provided by the application:
1) Reliability of message delivery (achieved by the reply mechanism of message middleware, i.e. determining the corresponding operation);
2) Reliability of the message (i.e., the message is not lost) (guaranteed by the persistence mechanism of the message middleware, i.e., monitoring of the service unit);
3) The transmitting end provides rollback operation;
4) The influence generated by the sender executing the retry operation for any number of times is the same as the influence of one execution.
5) A visualization unit is provided.
6) Each service call generates a global link id to track the overall link execution.
The application provides a processing method of a distributed transaction based on message middleware, which comprises the following steps: the sending end processes the processing request of the target event to obtain a processing success result, and sends the processing success result to the message middleware; the message middleware sends the acquired successful processing result to the consumer; if the consumption terminal receives the successful processing result, a target response is sent to the message middleware; and if the message middleware does not receive the target response, executing the step of sending the acquired successful processing result to the consumer side according to the configured retry strategy. The method can ensure the reliability and consistency of message and data transmission and improve the response rate of the request through the message middleware.
Corresponding to the method, the embodiment of the application also provides a processing device of the distributed transaction based on the message middleware, as shown in fig. 5, the device comprises:
the processing module 410 is configured to process the processing request of the target event by using the sending end, obtain a processing success result, and send the processing success result to the message middleware;
a sending module 420, configured to send, by using the message middleware, the obtained processing success result to the consumer;
if the consumption end receives the processing success result, the consumption end sends a target response to the message middleware;
and an execution module 430, configured to execute, if the message middleware does not receive the target response, a step of sending the obtained successful processing result to the consumer according to a configured retry strategy.
The functions of each functional unit of the processing device for distributed transaction based on the message middleware provided in the foregoing embodiments of the present application may be implemented by the foregoing method steps, so specific working processes and beneficial effects of each unit in the processing device for distributed transaction based on the message middleware provided in the embodiments of the present application are not repeated herein.
The embodiment of the application further provides an electronic device, as shown in fig. 6, including a processor 510, a communication interface 520, a memory 530, and a communication bus 540, where the processor 510, the communication interface 520, and the memory 530 complete communication with each other through the communication bus 540.
A memory 530 for storing a computer program;
the processor 510 is configured to execute the program stored in the memory 530, and implement the following steps:
the sending end processes the processing request of the target event to obtain a processing success result, and sends the processing success result to the message middleware;
the message middleware sends the acquired successful processing result to the consumption end;
if the consumption end receives the processing success result, the consumption end sends a target response to the message middleware;
and if the message middleware does not receive the target response, executing the step of sending the acquired successful processing result to the consumer terminal according to the configured retry strategy.
The communication bus mentioned above may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, or the like. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processing, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
Since the implementation manner and the beneficial effects of the solution to the problem of each device of the electronic apparatus in the foregoing embodiment may be implemented by referring to each step in the embodiment shown in fig. 2, the specific working process and the beneficial effects of the electronic apparatus provided in the embodiment of the present application are not repeated herein.
In yet another embodiment provided herein, a computer readable storage medium is provided, where instructions are stored, which when executed on a computer, cause the computer to perform a method for processing a distributed transaction based on message middleware according to any of the above embodiments.
In yet another embodiment provided herein, there is also provided a computer program product containing instructions that, when run on a computer, cause the computer to perform a method of processing a distributed transaction based on message middleware as described in any of the above embodiments.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, the present embodiments are intended to be construed as including the preferred embodiments and all such variations and modifications that fall within the scope of the embodiments herein.
It will be apparent to those skilled in the art that various modifications and variations can be made in the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. Thus, given that such modifications and variations of the embodiments in the present embodiments are within the scope of the embodiments and their equivalents, such modifications and variations are also intended to be included in the embodiments of the present application.

Claims (10)

1. The processing method of the distributed transaction based on the message middleware is characterized by being applied to a processing system comprising a service unit and the message middleware; the service unit comprises a sending end and a consuming end; the method comprises the following steps:
the sending end processes the processing request of the target event to obtain a processing success result, and sends the processing success result to the message middleware;
the message middleware sends the acquired successful processing result to the consumption end;
if the consumption end receives the processing success result, the consumption end sends a target response to the message middleware;
and if the message middleware does not receive the target response, executing the step of sending the acquired successful processing result to the consumer terminal according to the configured retry strategy.
2. The method of claim 1, wherein after sending the target information including processing success to the message middleware, the method further comprises:
the message middleware sends a first response to the sending terminal when receiving the processing success result;
when the sending end does not receive the first response sent by the message middleware, the sending end re-executes the step of sending a successful processing result to the message middleware;
and after the step of transmitting the successful processing result to the message middleware at least once is re-executed by the transmitting end, and the first response transmitted by the message middleware is not received, executing rollback operation.
3. The method of claim 2, wherein after performing the step of sending the obtained processing success result to the consumer according to a configured retry strategy, the method further comprises:
and if the target response is not received in the message middle, the message middle sends a rollback indication identifier to the sending end, and generates prompt information of rollback operation so that the sending end executes the rollback operation.
4. The method of claim 3, wherein the processing system further comprises a visualization unit;
and the visualization unit receives the prompt information of the rollback operation sent by the sending end and displays the prompt information.
5. The method of claim 4, wherein the processing system further comprises cache middleware;
the cache middleware identifies the processing states of the sending end, the consumption end and the message middleware for the target event, wherein the processing states of the sending end comprise executed, unexecuted and rolled back; the processing state of the consumer includes retried and rolled back.
6. The method of claim 1, wherein the retry strategy comprises an interval retry, an immediate retry, and a combined retry.
7. The method of claim 6, wherein the interval retries comprise a fixed interval retry, an incremental interval retry, and an exponentially increasing interval retry.
8. A processing device of a distributed transaction based on message middleware, which is characterized by being applied to a processing system comprising a service unit and the message middleware; the service unit comprises a sending end and a consuming end; the device comprises:
the processing module is used for processing the processing request of the target event by the sending end to obtain a processing success result and sending the processing success result to the message middleware;
the sending module is used for sending the acquired successful processing result to the consumption end by the message middleware;
if the consumption end receives the processing success result, the consumption end sends a target response to the message middleware;
and the execution module is used for executing the step of sending the acquired successful processing result to the consumption terminal according to the configured retry strategy if the message middleware does not receive the target response.
9. An electronic device, characterized in that the electronic device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are in communication with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1-7 when executing a program stored on a memory.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored therein a computer program which, when executed by a processor, implements the method steps of any of claims 1-7.
CN202311749267.6A 2023-12-15 2023-12-15 Distributed transaction processing method and device based on message middleware Pending CN117762652A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311749267.6A CN117762652A (en) 2023-12-15 2023-12-15 Distributed transaction processing method and device based on message middleware

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311749267.6A CN117762652A (en) 2023-12-15 2023-12-15 Distributed transaction processing method and device based on message middleware

Publications (1)

Publication Number Publication Date
CN117762652A true CN117762652A (en) 2024-03-26

Family

ID=90321408

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311749267.6A Pending CN117762652A (en) 2023-12-15 2023-12-15 Distributed transaction processing method and device based on message middleware

Country Status (1)

Country Link
CN (1) CN117762652A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118158184A (en) * 2024-05-11 2024-06-07 中移(苏州)软件技术有限公司 Information monitoring method and device and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118158184A (en) * 2024-05-11 2024-06-07 中移(苏州)软件技术有限公司 Information monitoring method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN111666162B (en) Distributed message transmission method, device, computer equipment and storage medium
CN106777026B (en) Method, device and system for supporting final consistency of micro-service architecture transaction
CN109714409B (en) Message management method and system
CN112118315A (en) Data processing system, method, device, electronic equipment and storage medium
CN102571850B (en) Transaction committing system, method and equipment
CN117762652A (en) Distributed transaction processing method and device based on message middleware
CN111277639A (en) Method and device for maintaining data consistency
US6185702B1 (en) Method and system for process state management using checkpoints
CN111159233A (en) Distributed caching method, system, computer device and storage medium
CN113496004A (en) Message sending method and device
CN111880947B (en) Data transmission method and device
CN112751743B (en) Message sending exception processing method, message sending device and electronic equipment
CN117879992A (en) Upgrade data transmission method and device, electronic equipment and storage medium
CN108241616B (en) Message pushing method and device
CN114816866A (en) Fault processing method and device, electronic equipment and storage medium
CN111049938B (en) Message notification method and device, electronic equipment and readable storage medium
CN114615284A (en) Method and device for notifying and receiving messages in cluster
CN113254097A (en) Configuration information issuing method and device, electronic equipment and storage medium
CN112181686A (en) Data processing method, device and system, electronic equipment and storage medium
CN111309744A (en) Object processing method and device, electronic equipment and computer readable storage medium
CN117950709A (en) Application interface management method, device, equipment and storage medium
CN113783666B (en) Method and device for processing business
CN109062931B (en) Cache synchronization control method, device, system, server and readable storage medium
CN103368754A (en) Service failure detection method, apparatus, system and device
CN116032437A (en) File transmission method and device, storage medium and electronic equipment

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