CN109471704A - A kind of flexible transaction methods based on message-oriented middleware - Google Patents
A kind of flexible transaction methods based on message-oriented middleware Download PDFInfo
- Publication number
- CN109471704A CN109471704A CN201811304916.0A CN201811304916A CN109471704A CN 109471704 A CN109471704 A CN 109471704A CN 201811304916 A CN201811304916 A CN 201811304916A CN 109471704 A CN109471704 A CN 109471704A
- Authority
- CN
- China
- Prior art keywords
- message
- transaction
- messaging service
- confirmation
- consumer
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/466—Transaction processing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/546—Message passing systems or structures, e.g. queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/54—Indexing scheme relating to G06F9/54
- G06F2209/547—Messaging middleware
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The flexible transaction methods based on message-oriented middleware that the invention discloses a kind of, by message, the producer sends a message to messaging service, after the execution of message producer's local service, retransmits confirmation message to messaging service, messaging service just really gives out information at this time, consumes for message consumer.The present invention is used as go-between role by the message-oriented middleware (messaging service) with affairs, can effectively ensure the consistency of affairs between each system.
Description
Technical field
The present invention relates to the technical fields of the distributing real time system of Internet application, are based on message more particularly to one kind
The flexible issued transaction of middleware.
Background technique
Distributed system is generally made of multiple independent particle systems, and multiple subsystems are cooperated with each other by interprocess communication matches
It closes and completes each function.Having could much be completed with regular meeting across multiple subsystems, such as lower single flow of payments of electric business shopping website
Journey can be related to transaction system and payment system, and can be related to the concept of affairs during this, that is, need to guarantee transaction system
The data consistency of system and payment system.The affairs usually referred to refer to the ACID attribute of single machine resource, are unable to satisfy multisystem
Between business requirements.
There are following concept and nouns in flexible issued transaction granting:
Flexible affairs: referring to the affairs for following BASE theory, and common implementation has: Two-phase commitment (2PC), TCC compensation
Property submit, message based asynchronous ensure type, best endeavors notice type.
BASE:Base IC ally Available (basically available), Soft state (flexible state), Eventually
The abbreviation of three phrases of consistent (final consistency).
TCC mode: Try-Confirm-Cancel
Try: completing all service observations (consistency), and reserving must service resources (quasi- isolation).
Confirm: really executing business, does not make any service observation, only uses Try stage reserved service resources,
Confirm operation meets idempotence.
Cancel: the service resources that the release Try stage is reserved, Cancel operation meet idempotence.
Message-oriented middleware: by providing message transmission and message queueing model, process can be extended under distributed environment
Between communication.
Summary of the invention
In view of the deficiencies of the prior art, the present invention is intended to provide a kind of flexible issued transaction side based on message-oriented middleware
Method can effectively ensure the consistent of affairs between each system by the message-oriented middleware with affairs as go-between role
Property.
To achieve the goals above, the present invention adopts the following technical scheme:
A kind of flexible transaction methods based on message-oriented middleware, include the following steps:
S1, the message producer send transaction message to messaging service in advance before executing local matter, and messaging service is only at this time
It records but does not issue the transaction message;
After the transaction message that S2, the messaging service confirmation message producer send in advance receives successfully, returns to reception and successfully disappear
It ceases and gives the message producer;
S3, the message producer start to execute local business logic, if executing failure, notification message service abandons the affairs
Message submits local matter, and notification message service publication transaction message is to message consumer, message if run succeeded
Consumer executes its local business logic after receiving the transaction message.
Further, in step S3, if message consumer executes local business logic success, local matter is submitted,
And sent to messaging service and consume successful confirmation message, the confirmation of consumption failure is sent to messaging service if executing failure
Message.
Further, if messaging service receives the successful confirmation message of consumption of message consumer's transmission, into
The removal of the row transaction message, if receiving the confirmation message of the consumption failure of message consumer's transmission, restarting publication should
For transaction message to message consumer, message consumer executes local business logic again, until message consumer consumes the affairs
Message success.
Further, timed message state confirmation is arranged in messaging service to scan, for the thing for having recorded but not issued
Message of being engaged in timing carries out transaction status confirmation to the message producer for sending the transaction message.
The beneficial effects of the present invention are:
1, in the present invention, go-between role is used as by the message-oriented middleware (messaging service) with affairs, it can be effective
Each system of guarantee between affairs consistency;
2, all transaction messages all would be communicated to messaging service, and the message conveyed does not repeat, messaging service processing
Random ordering will not occur for message;
3, messaging service setting timed message state confirmation scans, for recorded but the timing of non-posted transactions message to
The message producer for sending the transaction message carries out transaction status confirmation.
Detailed description of the invention
Fig. 1 is the implementation general illustration in the embodiment of the present invention.
Specific embodiment
Below with reference to attached drawing, the invention will be further described, it should be noted that the present embodiment is with this technology side
The premise of case, the detailed implementation method and specific operation process are given, but protection scope of the present invention is not limited to this reality
Apply example.
The flexible transaction methods based on message-oriented middleware that the present embodiment provides a kind of send message by the message producer
To messaging service, after the execution of message producer's local service, confirmation message is retransmited to messaging service, at this time messaging service
It really gives out information, is consumed for message consumer.Detailed step is as follows, as shown in Figure 1:
S1, the message producer send transaction message to messaging service in advance before executing local matter, and messaging service is only at this time
It records but does not issue the transaction message;
After the transaction message that S2, the messaging service confirmation message producer send in advance receives successfully, returns to reception and successfully disappear
It ceases and gives the message producer;
S3, the message producer start to execute local business logic;If run succeeded, local matter is submitted, and notify
Messaging service issues transaction message to message consumer, and notification message service abandons the transaction message if executing failure.
Message consumer executes its local business logic after receiving the transaction message, and local thing is submitted after running succeeded
Business, and sent to messaging service and consume successful confirmation message, consumption failure is sent to messaging service if executing failure
Confirmation message.
In the above-mentioned flexible transaction methods based on message-oriented middleware, only when the local matter of the message producer is held
When going successfully, messaging service could allow message consumer to consume the transaction message.Regardless of message consumer's consumed transaction disappears
Success or failure is ceased, the consumption confirmation message of success or failure is all sent to messaging service.
Further, the consumption confirmation message for the success or failure that messaging service is sent according to message consumer carries out thing
The removal for message of being engaged in restarts transmission transaction message to message consumer, until information consumption success.
Further, messaging service setting timed message state confirmation scans, for having recorded but non-posted transactions disappear
It ceases to the message producer for sending the transaction message and carries out transaction status confirmation.Messaging service is according to the affairs shape of the message producer
State carrys out rollback and still continues to send confirmation message.
For those skilled in the art, it can be made various corresponding according to above technical solution and design
Change and modification, and all these change and modification should be construed as being included within the scope of protection of the claims of the present invention.
Claims (4)
1. a kind of flexible transaction methods based on message-oriented middleware, which comprises the steps of:
S1, the message producer send transaction message to messaging service in advance before executing local matter, and messaging service only records at this time
But the transaction message is not issued;
After the transaction message that S2, the messaging service confirmation message producer send in advance receives successfully, returns to the successful message of reception and give
The message producer;
S3, the message producer start to execute local business logic, if executing failure, notification message service abandons the affairs and disappears
Breath submits local matter, and notification message service publication transaction message, to message consumer, message disappears if run succeeded
Expense person executes its local business logic after receiving the transaction message.
2. the flexible transaction methods according to claim 1 based on message-oriented middleware, which is characterized in that step S3
In, if message consumer executes local business logic success, local matter is submitted, and consume successfully to messaging service transmission
Confirmation message, if execute failure if to messaging service send consumption failure confirmation message.
3. the flexible transaction methods according to claim 2 based on message-oriented middleware, which is characterized in that messaging service
If receiving the successful confirmation message of consumption of message consumer's transmission, the removal of the transaction message is carried out, if received
The confirmation message of the consumption failure sent to message consumer, then restart and issue the transaction message to message consumer, message disappears
Expense person executes local business logic again, until message consumer consumes transaction message success.
4. the flexible transaction methods according to claim 2 based on message-oriented middleware, which is characterized in that messaging service
Middle setting timed message state confirmation scanning, for having recorded but the timing of non-posted transactions message is to sending the transaction message
The message producer carries out transaction status confirmation.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811304916.0A CN109471704A (en) | 2018-11-02 | 2018-11-02 | A kind of flexible transaction methods based on message-oriented middleware |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811304916.0A CN109471704A (en) | 2018-11-02 | 2018-11-02 | A kind of flexible transaction methods based on message-oriented middleware |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109471704A true CN109471704A (en) | 2019-03-15 |
Family
ID=65666776
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811304916.0A Pending CN109471704A (en) | 2018-11-02 | 2018-11-02 | A kind of flexible transaction methods based on message-oriented middleware |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109471704A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111666162A (en) * | 2020-04-30 | 2020-09-15 | 平安科技(深圳)有限公司 | Distributed message transmission method, device, computer equipment and storage medium |
CN111737331A (en) * | 2020-06-22 | 2020-10-02 | 中国银行股份有限公司 | Transaction consistency processing method and system for database and object storage |
CN112395102A (en) * | 2020-10-15 | 2021-02-23 | 北京仿真中心 | Distributed database middleware solution method |
CN112671827A (en) * | 2020-11-25 | 2021-04-16 | 紫光云技术有限公司 | Distributed transaction final consistency method |
CN114138516A (en) * | 2021-11-30 | 2022-03-04 | 北京声智科技有限公司 | State updating method, device, terminal and storage medium for resource transfer |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108009027A (en) * | 2017-11-23 | 2018-05-08 | 北京百度网讯科技有限公司 | Implementation method, device, equipment and the storage medium of queue message uniformity |
CN108306941A (en) * | 2018-01-05 | 2018-07-20 | 上海你我贷互联网金融信息服务有限公司 | A kind of distributed information system |
-
2018
- 2018-11-02 CN CN201811304916.0A patent/CN109471704A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108009027A (en) * | 2017-11-23 | 2018-05-08 | 北京百度网讯科技有限公司 | Implementation method, device, equipment and the storage medium of queue message uniformity |
CN108306941A (en) * | 2018-01-05 | 2018-07-20 | 上海你我贷互联网金融信息服务有限公司 | A kind of distributed information system |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111666162A (en) * | 2020-04-30 | 2020-09-15 | 平安科技(深圳)有限公司 | Distributed message transmission method, device, computer equipment and storage medium |
WO2021217986A1 (en) * | 2020-04-30 | 2021-11-04 | 平安科技(深圳)有限公司 | Distributed message transmission method and apparatus, computer device and storage medium |
CN111737331A (en) * | 2020-06-22 | 2020-10-02 | 中国银行股份有限公司 | Transaction consistency processing method and system for database and object storage |
CN111737331B (en) * | 2020-06-22 | 2023-08-18 | 中国银行股份有限公司 | Transaction consistency processing method and system for database and object storage |
CN112395102A (en) * | 2020-10-15 | 2021-02-23 | 北京仿真中心 | Distributed database middleware solution method |
CN112671827A (en) * | 2020-11-25 | 2021-04-16 | 紫光云技术有限公司 | Distributed transaction final consistency method |
CN112671827B (en) * | 2020-11-25 | 2023-03-07 | 紫光云技术有限公司 | Distributed transaction final consistency method |
CN114138516A (en) * | 2021-11-30 | 2022-03-04 | 北京声智科技有限公司 | State updating method, device, terminal and storage medium for resource transfer |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109471704A (en) | A kind of flexible transaction methods based on message-oriented middleware | |
CN100452707C (en) | A method and system for keeping data consistency | |
CN107277083B (en) | Data interaction processing method, device and system | |
CN105814542B (en) | Method and apparatus for distributed transactions in a data communications network | |
CN110288255A (en) | A kind of logistics method and device of distributed transaction | |
CN112650764A (en) | Cross-chain data processing method, device, equipment and storage medium | |
JP2009531749A (en) | Method and apparatus for reliable message notification between systems | |
CN105765555A (en) | Strict queue ordering in distributed system | |
JP6256904B2 (en) | Apparatus and method for distributing processing requests | |
US20040010581A1 (en) | Method for electronic tracking of an electronic device | |
CN115544044A (en) | Data consistency keeping method, device, equipment and storage medium | |
US20070296550A1 (en) | Edge server failover | |
CN114327804A (en) | Block chain based distributed transaction processing method, device, equipment and medium | |
CN110445834A (en) | A kind of method and system for solving propelling data and losing | |
CN113034178A (en) | Multi-system integral calculation method and device, terminal equipment and storage medium | |
CN114007111A (en) | Resource distribution method and device, electronic equipment and storage medium | |
CN106254373A (en) | Digital certificate synchronous method, digital signature server and digital certificate synchronize system | |
CN111242762A (en) | Financial product purchasing method, device and system | |
CN110944064A (en) | Remote access control system of embedded network | |
CN102880937A (en) | Process implementation method based on business process modeling notation international standard | |
CN112596865A (en) | System for pushing to-do message based on workflow affair | |
CN115361382A (en) | Data processing method, device, equipment and storage medium based on data group | |
CN110659300A (en) | Method for ensuring final consistency of distributed system data | |
CN103618700A (en) | Method for determining leader server in server system and server system | |
CN110764933A (en) | Message processing method, device and system and computing 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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190315 |
|
RJ01 | Rejection of invention patent application after publication |