CN101340400A - Asynchronous message processing method and system - Google Patents
Asynchronous message processing method and system Download PDFInfo
- Publication number
- CN101340400A CN101340400A CNA2008101469923A CN200810146992A CN101340400A CN 101340400 A CN101340400 A CN 101340400A CN A2008101469923 A CNA2008101469923 A CN A2008101469923A CN 200810146992 A CN200810146992 A CN 200810146992A CN 101340400 A CN101340400 A CN 101340400A
- Authority
- CN
- China
- Prior art keywords
- message
- targets
- server
- messages
- message server
- 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.)
- Granted
Links
Images
Landscapes
- Computer And Data Communications (AREA)
Abstract
The invention discloses an asynchronous message processing method and a system, thereby overcoming the shortcomings of the traditional polling processing method and causing a server to know the implementation result of a target system. The main proposal is as follows: A. a source system releases the type of a message on the server, the target system subscribes the message with the specified type from the server, thereby establishing the relationship between the release and the subscription of the message; B. the source system sends the message to be sent to the server and increases a parameter of whether callback is needed or not in the message, if the parameter is true, then the server needs to call back the implementation result of the message in the target system to the source system; C. the server receivers the message and then finds the corresponding target system according to the release/subscription relationship of the message; D. the target system receives the message and then implements the specified processing procedure, the implementation result is taken as a reply to the server, the reply message contains the parameter of whether the message needs to be re-sent or not, if the parameter is true, then the server re-sends the message to the target system.
Description
Technical field
The invention belongs to technical field of information processing, relate to the middleware (MessageMiddleware) that asynchronous message is handled, particularly relate to a kind of flow process that realizes message transmission integrated between distribution application system, reception, route, forwarding based on asynchronous message.
Background technology
Message-oriented middleware is to realize the integrated instrument of inter-system data, sets up being connected between system by the message issue of setting up between system with subscribing relationship.Sending a message to the message-oriented middleware server by message source system (Origin System) is message server (Message Server, MS is called for short in the back), server is delivered to targets of messages system (Dest System) according to subscribing relationship, and the targets of messages system finishes corresponding service processing according to content after receiving message.
Present numerous message-oriented middleware product in the mechanism that the realization middleware server forwards the message to the targets of messages system is: the targets of messages system regularly is connected to message server, whether inquiry has the message that belongs to native system, if have then message is got, this is a kind of processing method of poll.Adopt the mechanism of poll, if polling cycle is long, then the message transmission is passed to the targets of messages system and is had bigger delay, if polling cycle is smaller, and then can the more computer resource of loss ratio.
And current existing message-oriented middleware product just accomplishes to send a message to reliably the targets of messages system, message can't feed back to message server and message source system automatically at the execution result of targets of messages system, and the targets of messages system can not send certain bar message by request server once more.Often we can run into, and message message source system wishes to know that message determines then at the execution result of targets of messages system how next step handles.Sometimes we wish that also message server can be according to the execution result of message in the targets of messages system, carry out a certain operation automatically according to the strategy of prior setting, for example automatically the retransmission process failure to the targets of messages system.
Summary of the invention
The technical problem to be solved in the present invention provides a kind of asynchronous message processing method, and a kind of asynchronous message treatment system, adopting the inventive method/system can overcome the long then message of polling cycle that traditional poll processing method exists sends and passes to goal systems and bigger delay is arranged, the defective of the computer resource that the little then loss of polling cycle is more.
For solving the problems of the technologies described above, asynchronous message processing method of the present invention comprises the steps:
Step 1, message source system issue type of message on message server, the message of specified type is subscribed to by the targets of messages system to message server, thereby set up issue and subscribing relationship between message source system and the targets of messages system;
The message that step 2, message source system will send is passed to message server;
Step 3, message server receive that the publish/subscribe relation according to message finds corresponding targets of messages system after the described message of step 2, send this message to the targets of messages system then;
Step 4, targets of messages system receive the handling procedure of carrying out appointment after the message.
A kind of improvement as the inventive method, in step 2, when the message source system passes to message server with message, in message body, increase a parameter, whether need message server to adjust back the execution result of this message in goal systems to the message source system in order to expression; Correspondingly, after step 4, the inventive method also should comprise the steps:
Step 5, targets of messages system reply to message server with the result of the described execution of step 4;
Step 6, if the parametric representation of described increase needs message server to adjust back described execution result to the message source system, then message server adjusts back the described execution result of receiving of step 5 to the message source system.
Further, whether in step 5, the targets of messages system can also comprise a parameter in giving the answer message of message server, need message server to retransmit this message in order to expression;
If this parametric representation needs message server to retransmit this message, then message server is retransmitted this message to the targets of messages system.
Further, for fear of endless loop, message server is set maximum number of retransmissions, just no longer shifts this message onto the targets of messages system when reality is retransmitted number of times above this value.
Another kind as the inventive method improves, in step 2, if the message source system wishes to know the execution result of this message in the targets of messages system, when then the message source system passes to message server with message, in message body, increase a parameter, need message server to adjust back the execution result of this message in goal systems to the message source system in order to expression; Correspondingly, after step 4, the inventive method also should comprise the steps:
Step 5, targets of messages system reply to message server with the result of the described execution of step 4;
If comprise described parameter in the source message of the correspondence that the step 6 message server is received, then message server adjusts back the described execution result of receiving of step 5 to the message source system.
For solving the problems of the technologies described above, asynchronous message treatment system of the present invention comprises:
Message source system, message server and targets of messages system;
Wherein the type of message that will issue of message source system is registered at message server, the targets of messages system subscribes to the message of specified type to the message server, one class message can be subscribed to by a plurality of targets of messages system, thereby establishes issue and subscribing relationship between message source system and the targets of messages system;
The message that the message source system is used for sending is passed to message server;
Message server is used to receive that the publish/subscribe relation according to message finds corresponding targets of messages system after the described message, sends this message to the targets of messages system then;
The targets of messages system is used to receive the handling procedure of carrying out appointment after the described message.
Whether as a kind of improvement of system of the present invention, the message source system also is used for: when message is passed to message server, increase a parameter in message body, need message server to adjust back the execution result of this message in goal systems to the message source system in order to expression; Correspondingly,
The targets of messages system also is used for the execution result to the handling procedure of described appointment is replied to message server;
Then message server also is used for: if the parametric representation that increases described in its source message of receiving need be adjusted back described execution result, then the described execution result that the targets of messages system is transmitted is adjusted back to the message source system.
Further, the targets of messages system also is used for: the answer message giving message server, increase a parameter, and whether need message server to retransmit this message in order to expression; Correspondingly,
Message server also is used for: if the described parametric representation that the targets of messages system increases need be retransmitted this message, then retransmit this message to the targets of messages system.
Further, for fear of endless loop, message server also is used for: set maximum number of retransmissions, just no longer shift this message onto the targets of messages system when reality is retransmitted number of times above this value.
Another kind as system of the present invention improves, and the message source system also is used for:
If this system wishes to know the execution result of message in the targets of messages system, when then this system passes to message server with message, in message body, increase a parameter, need message server to adjust back the execution result of this message in goal systems to the message source system in order to expression; Correspondingly,
The targets of messages system also is used for the execution result to the handling procedure of described appointment is replied to message server;
Then message server also is used for: if its source message of receiving comprises described parameter, then the described execution result that the targets of messages system is transmitted is adjusted back to the message source system.
Beneficial effect of the present invention is as follows:
Asynchronous message processing method/system of the present invention, the mode that employing pushes away (push) sends to goal systems with message from message server, having overcome the long then message of polling cycle that traditional poll processing method exists sends and passes to goal systems bigger delay is arranged, the defective of the computer resource that the little then loss of polling cycle is more, simultaneously can allow message server or message source system know the execution result of message in goal systems, and can carry out a certain operation automatically according to the strategy of prior setting, for example automatic retransmission process failure is to goal systems.
Description of drawings
Fig. 1 is the structural representation of asynchronous message treatment system of the present invention;
Fig. 2 is the structural representation of message adapter;
Fig. 3 is that the message publish/subscribe concerns schematic diagram;
Fig. 4 is an asynchronous message treatment system workflow schematic diagram of the present invention;
Fig. 5 is a MA abnormality processing schematic flow sheet;
Fig. 6 is a MS abnormality processing schematic flow sheet.
Embodiment
Below in conjunction with the drawings and specific embodiments, the present invention is described in further detail.
Fig. 1 is the structural representation of asynchronous message treatment system of the present invention, and as shown in the figure, this system comprises message source system, message server and targets of messages system.
Message source system and targets of messages system all need integrated message adapter (Message Adapter, MA is called for short in the back), and " adapter address of service " will be registered on MS.MA is a software kit, is employed the system integration, is used to realize being connected of application system and MS.As shown in Figure 2, MA is made up of message sink module, message transmission module, message queue." the adapter address of service " that the message sink module externally exposes is used to receive the message from MS, routine interface (the Application interface that application system can provide by the message call sending module, abbreviation API) transmission of realization message, message queue is used to preserve Message Record.
MS is made up of message sink module, message queue, message routing module, message distribution module.The message sink module is used to receive the message from MA; Message queue is used to preserve Message Record; The message routing module finds all goal systems of specify message according to the publish/subscribe relation; The message distribution module is shifted message onto the MA of goal systems according to " the adapter address of service " of goal systems.
The message that the interface API of message source system call MA will send has been passed to MA, be set to " very " if whether the message source system " needs readjustment " with parameter when wishing to know message at the execution result of goal systems then at calling interface API, whether MA can " need parameter to adjust back " is put into message header and sends a message to MS.MS receives that the publish/subscribe relation according to message finds corresponding targets of messages system after the message, then message is shifted onto the MA of targets of messages system.The MA of targets of messages system receives the handling procedure of carrying out appointment after the message, and the execution result of message replied to MS, whether parameter " needed to retransmit " in replying message if the targets of messages system wishes that MS resends this message and be set to " very ".MS receives the message execution result that the targets of messages system is replied, if find that whether parameter " needs to retransmit " be " very " then can shift message once more onto the MA of targets of messages system, be " very " then message can be shifted onto the MA of message source system at the execution result of targets of messages system if whether the message header parameter of discovery source message " needs to adjust back ".
Fig. 3 is that the message publish/subscribe concerns schematic diagram, as shown in the figure, the message source system issues type of message on MS, the targets of messages system goes up the message of subscribing to specified type to MS, so just sets up issue and subscribing relationship between message source system and the targets of messages system.One class message can be simultaneously subscribed to by a plurality of targets of messages system.
Fig. 4 is the workflow schematic diagram of a specific embodiment of asynchronous message treatment system of the present invention, and as shown in the figure, asynchronous message handling process of the present invention comprises:
1, the message of message source system call MA sends the message that api interface will send and passes to MA, the parameter of need transmitting has " type of message ", " whether needing readjustment ", " message content ", and wherein whether parameter " needs readjustment " if for " very " then represent that origin system wishes to know the execution result of message in goal systems;
2, the MA of message source system generates " message id ", and parameter " message id ", " type of message ", " whether needing readjustment " are saved on the message header, and send a message to MS;
3, MS receives message, finds " the adapter address of service " of all targets of messages systems of this message and the MA of targets of messages system according to the publish/subscribe relation of type of message correspondence;
4, MS shifts message onto the MA of targets of messages system according to the MA of targets of messages system " adapter address of service ";
5, the MA of targets of messages system receives message, message is passed to the message processing program of targets of messages system;
6, after the intact message of targets of messages system handles, execution result is replied to MA, parameter has " execution result ", " whether needing to retransmit ", if whether " needing to retransmit " is " very " then represent that the targets of messages system wishes that MS retransmits this message;
7, the MA of targets of messages system replies to MS with execution result;
8, MS obtains the execution result of message, and whether obtain parameter from execution result " needs to retransmit ";
9, MS confirms that " whether needing to retransmit " is " very ", then source message is shifted once more onto the MA of targets of messages system; For fear of endless loop, need to set maximum number of retransmissions, when retransmitting number of times above this value, reality just no longer this message is shifted onto the MA of targets of messages system;
10, MS receives the execution result of message, finds the parameter of corresponding source message " whether to need readjustment ";
11, MS confirms that whether the parameter of source message " needs readjustment " is " very ", then shifts execution result onto the MA of message source system;
12, the MA of message source system receives execution result, the result is passed to the handling procedure of message source system.
Below provide the abnormality processing embodiment of MA, MS respectively:
Fig. 5 is a MA abnormality processing flow chart, and as shown in the figure, the abnormality processing of MA comprises the steps:
1, timer regularly triggers the exception handler of MA;
2, MA detect network and MS whether normal, if confirm all normally execution in step 2 then;
3, MA takes out from message queue and sends failure;
4, MA sends a message to MS, if send successfully then execution in step 5;
5, MA will send successful message and delete from message queue.
Fig. 6 is a MS abnormality processing flow chart, and as shown in the figure, the abnormality processing of MS comprises the steps:
1, timer regularly triggers the exception handler of MS;
2, MS detect network and MA whether normal, if confirm all normally execution in step 3 then;
3, MS takes out from message queue and sends failure;
4, MS shifts message onto MA, if successfully message is fallen back on then execution in step 5 of MA;
5, MS will send successful message and delete from message queue.
Above-described specific embodiment, technical scheme of the present invention is further described, institute it should be noted, the above only is specific embodiments of the invention, and those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of the technical scheme of claim record of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.
Claims (10)
1, a kind of asynchronous message processing method is characterized in that comprising the steps:
Step 1, message source system issue type of message on message server, the message of specified type is subscribed to by the targets of messages system to message server, thereby set up issue and subscribing relationship between message source system and the targets of messages system;
The message that step 2, message source system will send is passed to message server;
Step 3, message server receive that the publish/subscribe relation according to message finds corresponding targets of messages system after the described message of step 2, send this message to the targets of messages system then;
Step 4, targets of messages system receive the handling procedure of carrying out appointment after the message.
2, asynchronous message processing method according to claim 1 is characterized in that:
In step 2, when the message source system passes to message server with message, in message body, increase a parameter, whether need message server to adjust back the execution result of this message in order to expression in goal systems to the message source system; After step 4, this method also comprises the steps:
Step 5, targets of messages system reply to message server with the result of the described execution of step 4;
Step 6, if the parametric representation of described increase needs message server to adjust back described execution result to the message source system, then message server adjusts back the described execution result of receiving of step 5 to the message source system.
3, asynchronous message processing method according to claim 2 is characterized in that:
Whether in step 5, the targets of messages system also comprises a parameter in giving the answer message of message server, need message server to retransmit this message in order to expression;
If this parametric representation needs message server to retransmit this message, then message server is retransmitted this message to the targets of messages system.
4, asynchronous message processing method according to claim 3 is characterized in that:
Message server is set maximum number of retransmissions, just no longer shifts this message onto the targets of messages system when reality is retransmitted number of times above this value.
5, asynchronous message processing method according to claim 1 is characterized in that:
In step 2, if the message source system wishes to know the execution result of this message in the targets of messages system, then the message source system is when passing to message server with message, in message body, increase a parameter, need message server to adjust back the execution result of this message in goal systems to the message source system in order to expression; After step 4, this method also comprises the steps:
Step 5, targets of messages system reply to message server with the result of the described execution of step 4;
If comprise described parameter in the source message of the correspondence that the step 6 message server is received, then message server adjusts back the described execution result of receiving of step 5 to the message source system.
6, a kind of asynchronous message treatment system is characterized in that:
This system comprises message source system, message server and targets of messages system; Wherein establish the issue and the subscribing relationship of message between message source system and the targets of messages system by following manner:
The type of message that the message source system will issue is registered at message server, and the targets of messages system subscribes to the message of specified type to the message server, and a class message can be subscribed to by a plurality of targets of messages system;
In this system, the message that the message source system is used for sending is passed to message server;
Message server is used to receive that the publish/subscribe relation according to described message finds corresponding targets of messages system after the described message, sends this message to the targets of messages system then;
The targets of messages system is used to receive the handling procedure of carrying out appointment after the described message.
7, asynchronous message treatment system according to claim 6 is characterized in that:
Whether the message source system also is used for: when message is passed to message server, increase a parameter in message body, need message server to adjust back the execution result of this message in goal systems to the message source system in order to expression; Correspondingly,
The targets of messages system also is used for the execution result to the handling procedure of described appointment is replied to message server;
Message server also is used for: if the parametric representation that increases described in its source message of receiving need be adjusted back described execution result, then the described execution result that the targets of messages system is transmitted is adjusted back to the message source system.
8, asynchronous message treatment system according to claim 7 is characterized in that:
The targets of messages system also is used for: the answer message giving message server, increase a parameter, and whether need message server to retransmit this message in order to expression; Correspondingly,
Message server also is used for: if the described parametric representation that the targets of messages system increases need be retransmitted this message, then retransmit this message to the targets of messages system.
9, asynchronous message treatment system according to claim 8 is characterized in that:
Message server also is used for: set maximum number of retransmissions, just no longer shift this message onto the targets of messages system when reality is retransmitted number of times above this value.
10, asynchronous message treatment system according to claim 6 is characterized in that:
The message source system also is used for: if this system wishes to know the execution result of message in the targets of messages system, when then this system passes to message server with message, in message body, increase a parameter, need message server to adjust back the execution result of this message in goal systems to the message source system in order to expression; Correspondingly,
The targets of messages system also is used for the execution result to the handling procedure of described appointment is replied to message server;
Message server also is used for: if its source message of receiving comprises described parameter, then the described execution result that the targets of messages system is transmitted is adjusted back to the message source system.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2008101469923A CN101340400B (en) | 2008-08-29 | 2008-08-29 | Asynchronous message processing method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2008101469923A CN101340400B (en) | 2008-08-29 | 2008-08-29 | Asynchronous message processing method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101340400A true CN101340400A (en) | 2009-01-07 |
CN101340400B CN101340400B (en) | 2011-01-19 |
Family
ID=40214355
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2008101469923A Active CN101340400B (en) | 2008-08-29 | 2008-08-29 | Asynchronous message processing method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101340400B (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102611642A (en) * | 2012-02-27 | 2012-07-25 | 杭州闪亮科技有限公司 | System for processing nonsynchronous message and method for system to send message and monitor processing task |
CN102957594A (en) * | 2011-08-30 | 2013-03-06 | 深圳市金蝶友商电子商务服务有限公司 | Message queue-based message processing method, related device and system |
CN104579905A (en) * | 2013-10-15 | 2015-04-29 | 阿里巴巴集团控股有限公司 | Message passing method and system, MOM (message oriented middleware) server and receiving terminal |
CN106621332A (en) * | 2016-12-29 | 2017-05-10 | 北京奇虎科技有限公司 | Data request detection method and device |
CN103856392B (en) * | 2013-06-26 | 2017-05-24 | 上海携程商务有限公司 | Message push method, outgoing server using message push method and outgoing server system |
CN106909467A (en) * | 2017-02-28 | 2017-06-30 | 郑州云海信息技术有限公司 | A kind of distributed transaction processing method based on micro services framework |
CN112422670A (en) * | 2020-11-10 | 2021-02-26 | 广州凡科互联网科技股份有限公司 | Method for designing asynchronous push model based on intermediate message |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108196961B (en) * | 2017-12-28 | 2020-05-12 | 蜂助手股份有限公司 | Asynchronous message processing method, terminal, system and storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101251860B (en) * | 2008-03-10 | 2011-05-04 | 北京航空航天大学 | Web information publish administrating system and method |
-
2008
- 2008-08-29 CN CN2008101469923A patent/CN101340400B/en active Active
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102957594A (en) * | 2011-08-30 | 2013-03-06 | 深圳市金蝶友商电子商务服务有限公司 | Message queue-based message processing method, related device and system |
CN102611642A (en) * | 2012-02-27 | 2012-07-25 | 杭州闪亮科技有限公司 | System for processing nonsynchronous message and method for system to send message and monitor processing task |
CN103856392B (en) * | 2013-06-26 | 2017-05-24 | 上海携程商务有限公司 | Message push method, outgoing server using message push method and outgoing server system |
CN104579905A (en) * | 2013-10-15 | 2015-04-29 | 阿里巴巴集团控股有限公司 | Message passing method and system, MOM (message oriented middleware) server and receiving terminal |
CN104579905B (en) * | 2013-10-15 | 2018-11-06 | 阿里巴巴集团控股有限公司 | Message delivery method and system and MOM servers, receiving terminal |
CN106621332A (en) * | 2016-12-29 | 2017-05-10 | 北京奇虎科技有限公司 | Data request detection method and device |
CN106621332B (en) * | 2016-12-29 | 2021-01-26 | 北京奇虎科技有限公司 | Data request detection method and device |
CN106909467A (en) * | 2017-02-28 | 2017-06-30 | 郑州云海信息技术有限公司 | A kind of distributed transaction processing method based on micro services framework |
CN106909467B (en) * | 2017-02-28 | 2021-06-29 | 郑州云海信息技术有限公司 | Distributed transaction processing method based on micro-service architecture |
CN112422670A (en) * | 2020-11-10 | 2021-02-26 | 广州凡科互联网科技股份有限公司 | Method for designing asynchronous push model based on intermediate message |
Also Published As
Publication number | Publication date |
---|---|
CN101340400B (en) | 2011-01-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101340400B (en) | Asynchronous message processing method and system | |
US7813745B2 (en) | Method for implementing a push service | |
TWI259674B (en) | Method and apparatus for reducing transmission errors in a third generation cellular system | |
JP4948525B2 (en) | Instant message transmission method and system for mobile communication terminal | |
CN102377685B (en) | Subscription message sending system and subscription message sending method | |
CN101136828B (en) | RS485 based multi-host machine wired serial communication method | |
CN101841399B (en) | Method and device for implementing uplink synchronization HARQ (Hybrid Automatic Repeat Request) process in multi-base station cooperative receiving network | |
CN1960516A (en) | Duplicate notification message processing method in terminal | |
CN100583776C (en) | Network device internal node reliable multicast method, system and device | |
JPH09160858A (en) | Data resending method and server | |
CN103391521A (en) | Method, device and system for transmitting short message | |
US11582320B2 (en) | Message transmitting and receiving method, communication apparatus, and program | |
JP2005278190A (en) | Method of segmented transmission and automatic retransmission of mms message | |
US20090258632A1 (en) | System and method for delivering and enhancing messages in a wireless communication network | |
CN105228181A (en) | A kind of method, AP and system connected based on AP optimization TCP | |
CN116097666A (en) | Message transmission method, device, equipment and storage medium | |
CN106921619B (en) | Associated event processing method and device | |
CN101378538B (en) | Method and system for processing group-emitting message | |
US8276158B2 (en) | HTTP based bounding storage space protocol | |
JP4759418B2 (en) | Message recovery system and recovery method | |
KR101741213B1 (en) | System and method for data transmission based on multicast | |
CN110557728A (en) | short message sending method, device and network equipment | |
TWI856125B (en) | Communication control device and method, wireless communication device and method, and wireless communication terminal | |
CN115379400B (en) | Method and device for group short message receipt | |
US20240259767A1 (en) | Method for communicating messages between a plurality of pieces of user equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |