CN105242975A - Message transmission method and message middleware - Google Patents

Message transmission method and message middleware Download PDF

Info

Publication number
CN105242975A
CN105242975A CN201510535197.3A CN201510535197A CN105242975A CN 105242975 A CN105242975 A CN 105242975A CN 201510535197 A CN201510535197 A CN 201510535197A CN 105242975 A CN105242975 A CN 105242975A
Authority
CN
China
Prior art keywords
message
current
queue
affairs
service unit
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
CN201510535197.3A
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.)
Inspur Software Co Ltd
Original Assignee
Inspur Software 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 Inspur Software Co Ltd filed Critical Inspur Software Co Ltd
Priority to CN201510535197.3A priority Critical patent/CN105242975A/en
Publication of CN105242975A publication Critical patent/CN105242975A/en
Pending legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a message transmission method and message middleware. The message middleware comprises a message sending service unit, a message sending queue, a message receiving service unit and a message receiving queue, wherein the message sending service unit is used for receiving a first calling request sent by a message sender, receiving each message sent by the message sender according to the first calling request, storing each message in the message sending queue, extracting each message from the message sending queue and sending each message; and the message receiving service unit is used for receiving each message sent by the message sending service unit, storing each message in the message receiving queue, receiving a second calling request of a message receiver, and transmitting the messages in the message receiving queue to the message receiver according to the second calling request. According to the scheme, the difficulty in realizing message transmission can be lowered.

Description

A kind of method of transmission of messages and message-oriented middleware
Technical field
The present invention relates to the network communications technology, particularly a kind of method of transmission of messages and message-oriented middleware.
Background technology
In a communications system, need messaging between parties, to complete specific application function.At present, the method for conventional transmission of messages comprises: transmit leg calls corresponding application program, and uses the corresponding network transmission protocol, sends to take over party by needing the message sent; Take over party calls corresponding application program, and uses corresponding network transmission protocol receipt message.
Visible, adopt the method for transmission of messages conventional at present, application developer is in order to message transfer, the function how using network and operating system software must be learned, write corresponding application program to send and receive information, and exchange information does not have standard method, different application must specifically be programmed thus and one or more application communications under multi-platform, varying environment.Such as, in order to realize the communication on network between different host system, the knowledge (such as using the socket program design of TCP/IP) how exchanging information on network will be required to possess; In order to realize the communication in same main frame between different process, the knowledge such as message queue or named pipes (Pipes) possessing operating system will be required.Therefore, difficulty is realized larger.
Summary of the invention
The invention provides a kind of method and message-oriented middleware of transmission of messages, can reduce and realize difficulty.
An aspect of the embodiment of the present invention provides a kind of method of transmission of messages, is applied in message-oriented middleware, arranges message send queue and message sink queue, also comprises:
First call request of receipt message transmit leg;
According to the first call request, each message that receipt message transmit leg is sent, by this each message stored in message send queue;
Take out message current in message send queue one by one, and send the first message of current taking-up to message sink queue;
To take out in message send queue and the first message sent, be saved in message sink queue;
Second call request of receipt message take over party;
According to the second call request, by the transmission of messages in message sink queue to message receiver.
Describedly send to message sink queue the first message comprising current taking-up and comprise:
Start the first affairs, perform under the first affairs: the first message sending current taking-up to message sink queue, and wait for the feedback code of corresponding first message, if do not receive feedback code before the timeout, if or receive feedback code before the timeout and feedback code represent receive mistake time, then trigger rollback affairs, return the process under execution first affairs; If receive feedback code before the timeout and feedback code represent receive correct time, then trigger submit to affairs, return the process that message current in message send queue is taken out in execution next time;
And/or,
Describedly will to take out in message send queue and the first message sent is saved in message sink queue comprises:
Current taking-up in receipt message transmit queue the first message sent, judge that whether the current message that receives is expect the first message received, if not, then return the feedback code representing and receive mistake, if so, then start the second affairs, perform under the second affairs: the first message received is saved in message sink queue, judge whether message preserves successfully, if so, then trigger and submit affairs to, if not, then trigger rollback affairs, return the process under execution second affairs.
Described from message send queue, take out current message after, and described send the first message of current taking-up to message sink queue before, comprise further: in described first message, carry message header, this message header comprises in message send queue No. ID of the first message; This No. ID is the sequence number of the first message in message send queue;
Whether the current message that described judgement receives is expect that the first message received comprises: from current message, parse message header, according to No. ID that message header in the message header parsed No. ID and the upper message received carries, judge that whether current message is the adjacent next message of the upper message received, if not, then determine that current message is not the first message that described expection receives; If so, determine that current message is the first message that expection receives.
Described message header comprises the check code of the first message further;
Judge current message be on the message received adjacent next message after, and determining that current message is expect before the first message of receiving, comprising further:
Judge that whether the current check code calculated is identical with the check code in the message header parsed, if identical, then determine that current message is the first message that expection receives, if not identical, then determine that current message is not the first message that expection receives.
A kind of message-oriented middleware, comprising: message sends service unit, message send queue, message sink service unit and message sink queue, wherein
Message sends service unit, for the first call request that receipt message transmit leg is sent; According to the first call request, each message that receipt message transmit leg is sent, by this each message stored in message send queue; And, take out message current in message send queue one by one, send the first message of current taking-up;
Message sink service unit, sending the first message of the current transmission of service unit, being saved in message sink queue for receiving described message; And second call request of receipt message take over party; According to the second call request, the message in message sink queue is taken out one by one and is transferred to message receiver.
Described message send service unit perform described send the process of the first message of current taking-up to message sink queue time, concrete execution: start the first affairs, perform under the first affairs: the first message sending current taking-up to message sink service unit, and wait for the feedback code of corresponding first message, if do not receive feedback code before the timeout, if or receive feedback code before the timeout and feedback code represent receive mistake time, then trigger rollback affairs, return the process under execution first affairs; If receive feedback code before the timeout and feedback code represent receive correct time, then trigger submit to affairs.
Described message sink service unit sends the first message of the current transmission of service unit performing the described message of described reception, when being saved in message sink queue, specifically perform:
Described message sink service unit receives the current message that described message transmission service unit is sent, judge whether the current message received is the first message that expection receives, if not, then return the feedback code representing and receive mistake, if, then start the second affairs, perform under the second affairs: the first message received is saved in message sink queue, judge whether message preserves successfully, if so, then trigger and submit affairs to, if not, then trigger rollback affairs, return the process under execution second affairs.
Described message sends service unit, further after take out the first message from message send queue, and before sending the first message to message sink service unit, in described first message, carrying message header, this message header comprises in message send queue No. ID of the first message; This No. ID is the sequence number of the first message in message send queue;
Described message sink service unit, judging whether the current message that receives is when expecting the first message received, concrete execution: described message sink service unit parses message header from current message, according to No. ID that message header in the message header parsed No. ID and the upper message received carries, judge that whether current message is the adjacent next message of the upper message received, if not, then determine that current message is not the first message that described expection receives; If so, then determine that current message is the first message that expection receives.
Described message sends service unit, carries the check code of the first message further in described message header;
Described message sink service unit, further judge current message be on the message received adjacent next message after, and determining that current message is expect before the first message of receiving, judge that whether the current check code calculated is identical with the check code in the message header parsed, if identical, then perform and describedly determine that current message is expect the first message of receiving, if not identical, then determine that current message is not expect the first message received.
Described message sends service unit and is used for providing putMqAPI interface to message sender, utilizes the first call request that this putMqAPI interface message sender is sent;
Described message sink service unit is used for providing getMqAPI interface to message sender, utilizes the second call request that this getMqAPI interface message receiver is sent.
Visible, the method of the transmission of messages that the embodiment of the present invention provides and message-oriented middleware, Effect-based operation transmit queue and message sink queue two queues can complete the transmission of message, that is, in message sender side, without the need to writing the corresponding application program sending message, only need message call middleware, message is saved in message send queue, and in message receiver side, without the need to writing the application program of corresponding receipt message, only need message call middleware, message is saved in message sink queue, therefore, grasp complicated application program without the need to user to write, such as, without the need to resting in the knowledge (such as using the socket program design of TCP/IP) how network exchanging information, also without the need to grasping the knowledge such as message queue or named pipes of operating system.Therefore, reduce and realize difficulty.
Accompanying drawing explanation
Fig. 1 is the process flow diagram of method for message transmission in one embodiment of the invention.
Fig. 2 is the structural representation of message-oriented middleware in one embodiment of the invention.
Fig. 3 is the process flow diagram that in another embodiment of the present invention, Effect-based operation middleware carries out the method for transmission of messages.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described.Obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
One embodiment of the invention proposes a kind of method of transmission of messages, is applied in message-oriented middleware, see Fig. 1, comprising:
101: pre-set message send queue and message sink queue;
102: the first call request of receipt message transmit leg;
103: according to the first call request, each message that receipt message transmit leg is sent, by this each message sequence stored in message send queue;
104: take out message current in message send queue one by one, and send the first message of this current taking-up to message sink queue;
105: will take out in message send queue and the first message sent, be saved in message sink queue;
106: second call request of receipt message take over party;
107: according to the second call request, the message in message sink queue is taken out one by one and is transferred to message receiver.
The transmission method of the message shown in above-mentioned Fig. 1 Effect-based operation transmit queue and message sink queue two queues can complete the transmission of message, that is, in message sender side, without the need to writing the corresponding application program sending message, only need message call middleware, message is saved in message send queue, and in message receiver side, without the need to writing the application program of corresponding receipt message, only need message call middleware, message is saved in message sink queue, therefore, grasp complicated application program without the need to user to write, such as, without the need to resting in the knowledge (such as using the socket program design of TCP/IP) how network exchanging information, also without the need to grasping the knowledge such as message queue or named pipes of operating system.Therefore, reduce and realize difficulty.
In an embodiment of the invention, in message send queue side, the transmission of message can be carried out based on the mode of affairs, now, in above-mentioned steps 104, describedly send to message sink queue the process comprising the first message of current taking-up and specifically can comprise:
Start first and start affairs, perform under starting affairs (BEGINTRANSACTION) first: the first message sending current taking-up to message sink queue, and wait for the feedback code of corresponding first message, if do not receive feedback code before the timeout, if or receive feedback code before the timeout and feedback code represent receive mistake time, then trigger the first rollback affairs (ROLLBACKTRANSACTION), to return the process that execution first starts under affairs; If receive feedback code before the timeout and feedback code represent receive correct time, then trigger first submit to affairs (COMMITTRANSACTION).
In an embodiment of the invention, in message sink queue side, also can carry out the reception of message based on the mode of affairs, now, above-mentioned steps 105 can comprise:
Take out in receipt message transmit queue and the current message sent, judge whether the current message received is the first message that expection receives, if not, then return the feedback code representing and receive mistake, if, then perform second and start affairs, perform under starting affairs second: the first message received is saved in message sink queue, judge whether message preserves successfully, if so, then trigger second and submit affairs to, if not, then trigger the second rollback affairs, to return the process that execution second starts under affairs.
State on the invention in embodiment, carry out the transmission of message based on the mode of affairs in message send queue side, or, carry out the reception of message based on the mode of affairs in message sink queue side, can realize: one group of associative operation is combined as all success or an all failed unit, can Fault recovery be simplified and make application program more reliable.
In an embodiment of the invention, in order to ensure that message is strictly orderly further, and ensure that message recipient can not leak receipts, heavily receive message, the ID that one can represent the sequence of message in message send queue number can be increased in the message of transmission, such as, first message entering message send queue, ID is increased in the message header of message, the value of this ID is 1, second message entering message send queue, ID is increased in the message header of message, the value of this ID is 2, by that analogy, correspondingly, according to this ID, take over party then can determine that whether the transmission of current message is orderly, whether existence is leaked is received or heavily receives.Under this kind of mode, in the embodiment based on the flow process shown in above-mentioned Fig. 1, in step 104, described from message send queue, take out the first message after, and described send the first message to message sink queue before, comprise further: in described first message, carry message header, this message header comprises in message send queue No. ID of the first message; This No. ID is the sequence number of the first message in message send queue.Correspondingly, when also carrying out the reception of message based on the mode of affairs, judge in step 105 whether the current message received is expect that the first message received comprises: from current message, parse message header, according to No. ID that message header in the message header parsed No. ID and the upper message received carries, judge that whether current message is the adjacent next message of the upper message received, if not, then determine that current message is not the first message that described expection receives; If so, determine that current message is the first message that expection receives.Such as, in the upper message received, the ID value of message header is 5, if then in current message the ID value of message header be 6, then determine that current is order transfer, message recipient does not leak receipts, heavily receives message.
In order to prevent wrong receipts message further, or preventing from receiving the message after being tampered, when have employed the mode of carrying message header in the message, in one embodiment of the invention, in step 104, comprising the check code of the first message further at described message header;
Correspondingly, in step 105, judge current message be on the message received adjacent next message after, and determining that current message is expect before the first message of receiving, comprising further:
Judge that whether the current check code calculated is identical with the check code in the message header parsed, if identical, then determine that current message is the first message that expection receives, if not identical, then determine that current message is not the first message that expection receives.
One embodiment of the invention also proposed a kind of message-oriented middleware, see Fig. 2, comprising: message sends service unit 201, message send queue 202, message sink service unit 203 and message sink queue 204, wherein
Message sends service unit 201, for the first call request that receipt message transmit leg is sent; According to the first call request, each message that receipt message transmit leg is sent, by this each message sequence stored in message send queue 202; And, take out message current in message send queue 202 one by one, and send the first message of current taking-up;
Message sink service unit 203, sending the first message of the current transmission of service unit 201, being saved in message sink queue 204 for receiving described message; And second call request of receipt message take over party; According to the second call request, the message in message sink queue 204 is taken out one by one and is transferred to message receiver.
In an embodiment of the invention, described message sends service unit 201 can carry out message transmission based on the mode of affairs, now, described message send service unit 201 perform described send the process of the first message of current taking-up to message sink queue time, concrete execution: start first and start affairs, perform under starting affairs first: the first message sending current taking-up to message sink service unit 203, and wait for the feedback code of corresponding first message, if do not receive feedback code before the timeout, if or receive feedback code before the timeout and feedback code represent receive mistake time, then trigger the first rollback affairs, return execution first start affairs under process, if receive feedback code before the timeout and feedback code represent receive correct time, then trigger first submit to affairs.
In an embodiment of the invention, described message sink service unit 203 can carry out the transmission of message based on the mode of affairs, now, described message sink service unit 203 sends the first message of the current transmission of service unit 201 performing the described message of described reception, when being saved in message sink queue, specifically perform:
Described message sink service unit 203 receives the current message that described message transmission service unit 201 is sent, judge whether the current message received is the first message that expection receives, if not, then return the feedback code representing and receive mistake, if, then start second and start affairs, perform under starting affairs second: the first message received is saved in message sink queue 204, judge whether message preserves successfully, if, then trigger second and submit affairs to, if not, then trigger the second rollback affairs, return execution second start affairs under process.
In an embodiment of the invention, in order to ensure that message is in order strict further and ensure that message recipient can not leak receipts, heavily receive message, described message sends service unit 201, further after take out the first message from message send queue 202, and before sending the first message to message sink service unit 203, in described first message, carry message header, this message header comprises in message send queue 202 No. ID of the first message; This No. ID is the sequence number of the first message in message send queue 202;
Described message sink service unit 203, judging whether the current message that receives is when expecting the first message received, concrete execution: described message sink service unit 203 parses message header from current message, according to No. ID that message header in the message header parsed No. ID and the upper message received carries, judge that whether current message is the adjacent next message of the upper message received, if not, then determine that current message is not the first message that described expection receives; If so, then determine that current message is the first message that expection receives.
In order to prevent wrong receipts message further, or prevent from receiving the message after being tampered, when have employed the mode of carrying message header in the message, in one embodiment of the invention, described message sends service unit 201, carries the check code of the first message further in described message header;
Described message sink service unit 203, further judge current message be on the message received adjacent next message after, and determining that current message is expect before the first message of receiving, judge that whether the current check code calculated is identical with the check code in the message header parsed, if identical, then perform and describedly determine that current message is expect the first message of receiving, if not identical, then determine that current message is not expect the first message received.
In an embodiment of the invention, described message sends service unit 201 for providing putMqAPI interface to message sender, utilizes the first call request that this putMqAPI interface message sender is sent;
Described message sink service unit 203, for providing getMqAPI interface to message sender, utilizes the second call request that this getMqAPI interface message receiver is sent.
In order to clearly describe the process of transmission of messages in one embodiment of the invention, see Fig. 2 and Fig. 3, in conjunction with the message-oriented middleware that one embodiment of the invention proposes, the process utilizing this message-oriented middleware to realize transmission of messages comprises:
301: message sends service unit and provides putMqAPI interface to message sender.
302: message sender calls this putMqAPI interface, send to message to send service unit by needing the message of transmission.
303: message sends each message that message sender is sent by service unit, and put into message send queue successively in order, such as, first message puts into the afterbody of message send queue.
When message send queue is full, following step 304 can be performed.
304: message sends service unit and takes out current message from the current tail of message send queue, is designated as message A.
305: message sends service unit and starts beginning affairs 1.
306: in beginning affairs 1 time, for the message A of current taking-up, message sends service unit and carry message header in message A, this message header comprises the check code of the sequence of message A in message send queue number and this message A.
Such as, message A is the message that in message send queue, first is taken out, then message header comprises the sequence number that ID value is 1.For another example, message A is the message that in message send queue, second is taken out, then message header comprises the sequence number that ID value is 2.
In same message send queue to the every bar message added can from 1 serial number, the maximal value of message number is 0xFFFFFFFF, after reaching maximal value from 1 circulation restart numbering.
307: message sends service unit and sends message A to message sink service unit message, start timer, and wait for the feedback code of corresponding message A.
308: in beginning affairs 1 time, message sends service unit and judges whether to receive before timer expiry the expression that message sink service unit sends and receive correct feedback code, if so, then performs 309, otherwise, execution 310.
309: message sends service unit and triggers submission affairs 1, performs 311.
For the message in each message send queue taken out, all perform the process of above-mentioned 304 to 309.
310: message sends service unit and triggers rollback affairs 1, for the retransmission process of current message A, returns 305.
311: message sink service unit receives a piece of news, from this message, parse message header.
312: message sink service unit, according to the ID value in the message header parsed, judges whether this ID value is that the ID value that in the upper message received, message header carries adds 1, if not, then performs 313, if so, perform 314.
313: message sink service unit sends service unit to message and returns the feedback code representing and receive mistake, returns 311.
314: message sink service unit judges that whether the current check code calculated is identical with the check code in the message header parsed, and if so, then performs 315, otherwise, turn to execution 313.
315: message sink service unit determination current message is expect to send the message A received service unit to message and return the feedback code representing that reception is correct.
316: message sink service unit starts execution and starts affairs 2, starting affairs 2 times, the message A received is saved in message sink queue by message sink service unit.
317: message sink service unit judges whether message A preserves successfully, if so, then performs 318, if not, perform 316.
318: message sink service unit triggers submits affairs 2 to, performs 320.
319: message sink service unit triggers rollback affairs 2, to return the process of execution 316.
Each current message received for message sink service unit all performs the process of above-mentioned steps 311 to 319.
320: message sink service unit provides getMqAPI interface to message receiver, message receiver calls this putMqAPI interface.
321: the message in message sink queue is taken out and sent to message receiver by message sink service unit one by one.
It should be noted that, the process of each step described in above-mentioned Fig. 3 does not have the sequencing on performing, and is the describing mode taked for convenience of description.Such as, some process that message sends service unit process with some of message sink service unit and perform respectively simultaneously.
The content such as information interaction, implementation between each unit in the said equipment, due to the inventive method embodiment based on same design, particular content can see in the inventive method embodiment describe, repeat no more herein.
Each embodiment of the present invention at least has following beneficial effect:
1, in the embodiment of the present invention, Effect-based operation transmit queue and message sink queue two queues can complete the transmission of message, that is, in message sender side, without the need to writing the corresponding application program sending message, only need message call middleware, message is saved in message send queue, and in message receiver side, without the need to writing the application program of corresponding receipt message, only need message call middleware, message is saved in message sink queue, therefore, grasp complicated application program without the need to user to write, such as, without the need to resting in the knowledge (such as using the socket program design of TCP/IP) how network exchanging information, also without the need to grasping the knowledge such as message queue or named pipes of operating system.Therefore, reduce and realize difficulty, thus also ensure that the transmitting of message.
2, in the embodiment of the present invention, the mode of distributed transaction can be adopted to realize transmission of messages, that is, in message send queue side, affairs can be started by execution one first, and correspondingly perform the first rollback affairs or first according to the result that message sends and submit to affairs to complete the process of message send queue side.And in message sink queue side, different affairs are adopted from message send queue side, i.e. distributing real time system thought, can start affairs by execution one second, and correspondingly performs the second rollback affairs or the second submission affairs according to the result of message sink.The processing mode of this kind of distributed transaction further ensures the reliability of transmission of messages.
3, carry out the transmission of message based on the mode of affairs in message send queue side, or, carry out the reception of message based on the mode of affairs in message sink queue side, can realize: by one group of associative operation being combined as all success or an all failed unit, can Fault recovery being simplified and make application program more reliable.
4, in the embodiment of the present invention, can comprise in the message of two queue transmission and transmit specific message header corresponding to queue, such as comprise in message send queue No. ID of current message at message header, and this No. ID is not the identification message of message content, but the sequence number of current message in message send queue, like this, in message sink queue side, only need to judge that whether current message is the next neighboring message in message send queue of the message of a upper reception according in current receipt message No. ID, as by judging No. ID whether than No. ID large 1 of a upper message, judge whether message is sent in order in order and receive in message send queue and message sink queue, therefore, further ensure the reliability of transmission of messages.
3, in the embodiment of the present invention, the check code of message can also be carried in the message header of message, like this, can judge that whether the message that message sink queue needs to receive is correct further by check code, malice such as whether in transmitting procedure is distorted, when receiving incorrect, can the re-transmission of Trigger message, further ensure the reliability of transmission of messages.
It should be noted that, in this article, the relational terms of such as first and second and so on is only used for an entity or operation to separate with another entity or operational zone, and not necessarily requires or imply the relation that there is any this reality between these entities or operation or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, article or equipment and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method, article or equipment.When not more restrictions, the key element " being comprised a 〃 〃 〃 〃 〃 〃 " limited by statement, and be not precluded within process, method, article or the equipment comprising described key element and also there is other same factor.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment made, equivalent replacement, improvement etc., all should be included within the scope of protection of the invention.

Claims (10)

1. a method for transmission of messages, is characterized in that, is applied in message-oriented middleware, arranges message send queue and message sink queue, also comprises:
First call request of receipt message transmit leg;
According to the first call request, each message that receipt message transmit leg is sent, by this each message stored in message send queue;
Take out message current in message send queue one by one, and send the first message of current taking-up to message sink queue;
To take out in message send queue and the first message sent, be saved in message sink queue;
Second call request of receipt message take over party;
According to the second call request, the message in message sink queue is taken out one by one and is transferred to message receiver.
2. method according to claim 1, is characterized in that,
Describedly send to message sink queue the first message comprising current taking-up and comprise:
Start first and start affairs, perform under the first affairs: the first message sending current taking-up to message sink queue, and wait for the feedback code of corresponding first message, if do not receive feedback code before the timeout, if or receive feedback code before the timeout and feedback code represent receive mistake time, then trigger rollback affairs, return the process under execution first affairs; If receive feedback code before the timeout and feedback code represent receive correct time, then trigger submit to affairs, return the process that message current in message send queue is taken out in execution next time;
And/or,
Describedly will to take out in message send queue and the first message sent is saved in message sink queue comprises:
Current taking-up in receipt message transmit queue the current message sent, judge that whether the current message that receives is expect the first message received, if not, then return the feedback code representing and receive mistake, if so, then start second and start affairs, perform under the second affairs: the first message received is saved in message sink queue, judge whether message preserves successfully, if so, then trigger and submit affairs to, if not, then trigger rollback affairs, return the process under execution second affairs.
3. method according to claim 2, it is characterized in that, described from message send queue, take out current message after, and described send the first message of current taking-up to message sink queue before, comprise further: in described first message, carry message header, this message header comprises in message send queue No. ID of the first message; This No. ID is the sequence number of the first message in message send queue;
Whether the current message that described judgement receives is expect that the first message received comprises: from current message, parse message header, according to No. ID that message header in the message header parsed No. ID and the upper message received carries, judge that whether current message is the adjacent next message of the upper message received, if not, then determine that current message is not the first message that described expection receives; If so, determine that current message is the first message that expection receives.
4. method according to claim 3, is characterized in that, described message header comprises the check code of the first message further;
Judge current message be on the message received adjacent next message after, and determining that current message is expect before the first message of receiving, comprising further:
Judge that whether the current check code calculated is identical with the check code in the message header parsed, if identical, then determine that current message is the first message that expection receives, if not identical, then determine that current message is not the first message that expection receives.
5. a message-oriented middleware, is characterized in that, comprising: message sends service unit, message send queue, message sink service unit and message sink queue, wherein
Message sends service unit, for the first call request that receipt message transmit leg is sent; According to the first call request, each message that receipt message transmit leg is sent, by this each message sequence stored in message send queue; And, take out message current in message send queue one by one, send the first message of current taking-up;
Message sink service unit, sending the first message of the current transmission of service unit, being saved in message sink queue for receiving described message; And second call request of receipt message take over party; According to the second call request, by the transmission of messages in message sink queue to message receiver.
6. message-oriented middleware according to claim 5, it is characterized in that, described message send service unit perform described send the process of the first message of current taking-up to message sink queue time, concrete execution: start the first affairs, perform under the first affairs: the first message sending current taking-up to message sink service unit, and wait for the feedback code of corresponding first message, if do not receive feedback code before the timeout, if or receive feedback code before the timeout and feedback code represent receive mistake time, then trigger rollback affairs, return the process under execution first affairs, if receive feedback code before the timeout and feedback code represent receive correct time, then trigger submit to affairs.
7. message-oriented middleware according to claim 6, is characterized in that, described message sink service unit sends the first message of the current transmission of service unit performing the described message of described reception, when being saved in message sink queue, specifically performs:
Described message sink service unit receives the current message that described message transmission service unit is sent, judge whether the current message received is the first message that expection receives, if not, then return the feedback code representing and receive mistake, if, then start the second affairs, perform under the second affairs: the first message received is saved in message sink queue, judge whether message preserves successfully, if so, then trigger and submit affairs to, if not, then trigger rollback affairs, return the process under execution second affairs.
8. message-oriented middleware according to claim 7, it is characterized in that, described message sends service unit, further after take out the first message from message send queue, and before sending the first message to message sink service unit, in described first message, carry message header, this message header comprises in message send queue No. ID of the first message; This No. ID is the sequence number of the first message in message send queue;
Described message sink service unit, judging whether the current message that receives is when expecting the first message received, concrete execution: described message sink service unit parses message header from current message, according to No. ID that message header in the message header parsed No. ID and the upper message received carries, judge that whether current message is the adjacent next message of the upper message received, if not, then determine that current message is not the first message that described expection receives; If so, then determine that current message is the first message that expection receives.
9. message-oriented middleware according to claim 8, is characterized in that, described message sends service unit, carries the check code of the first message further in described message header;
Described message sink service unit, further judge current message be on the message received adjacent next message after, and determining that current message is expect before the first message of receiving, judge that whether the current check code calculated is identical with the check code in the message header parsed, if identical, then perform and describedly determine that current message is expect the first message of receiving, if not identical, then determine that current message is not expect the first message received.
10. according to described message-oriented middleware arbitrary in claim 5 to 9, it is characterized in that, described message sends service unit and is used for providing putMqAPI interface to message sender, utilizes the first call request that this putMqAPI interface message sender is sent;
Described message sink service unit is used for providing getMqAPI interface to message sender, utilizes the second call request that this getMqAPI interface message receiver is sent.
CN201510535197.3A 2015-08-27 2015-08-27 Message transmission method and message middleware Pending CN105242975A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510535197.3A CN105242975A (en) 2015-08-27 2015-08-27 Message transmission method and message middleware

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510535197.3A CN105242975A (en) 2015-08-27 2015-08-27 Message transmission method and message middleware

Publications (1)

Publication Number Publication Date
CN105242975A true CN105242975A (en) 2016-01-13

Family

ID=55040629

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510535197.3A Pending CN105242975A (en) 2015-08-27 2015-08-27 Message transmission method and message middleware

Country Status (1)

Country Link
CN (1) CN105242975A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106254445A (en) * 2016-07-29 2016-12-21 深圳前海微众银行股份有限公司 Message method and service end
CN107040455A (en) * 2017-05-27 2017-08-11 北京思特奇信息技术股份有限公司 A kind of instant messaging communication method and system based on redis
CN107656825A (en) * 2017-09-01 2018-02-02 上海艾融软件股份有限公司 Message treatment method, apparatus and system
CN108965457A (en) * 2018-08-02 2018-12-07 郑州云海信息技术有限公司 A kind of message delivery method of distributed cluster system, device, equipment and medium
CN110968431A (en) * 2018-09-28 2020-04-07 阿里巴巴集团控股有限公司 Message processing method, device and equipment
CN111225012A (en) * 2018-11-27 2020-06-02 阿里巴巴集团控股有限公司 Transaction processing method, device and equipment
CN113448757A (en) * 2021-08-30 2021-09-28 阿里云计算有限公司 Message processing method, device, equipment, storage medium and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1817014A (en) * 2003-05-27 2006-08-09 国际商业机器公司 System for defining an alternate channel routing mechanism in a messaging middleware environment
CN102957594A (en) * 2011-08-30 2013-03-06 深圳市金蝶友商电子商务服务有限公司 Message queue-based message processing method, related device and system
CN103634707A (en) * 2012-08-23 2014-03-12 上海斐讯数据通信技术有限公司 Communication method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1817014A (en) * 2003-05-27 2006-08-09 国际商业机器公司 System for defining an alternate channel routing mechanism in a messaging middleware environment
CN102957594A (en) * 2011-08-30 2013-03-06 深圳市金蝶友商电子商务服务有限公司 Message queue-based message processing method, related device and system
CN103634707A (en) * 2012-08-23 2014-03-12 上海斐讯数据通信技术有限公司 Communication method

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106254445A (en) * 2016-07-29 2016-12-21 深圳前海微众银行股份有限公司 Message method and service end
CN107040455A (en) * 2017-05-27 2017-08-11 北京思特奇信息技术股份有限公司 A kind of instant messaging communication method and system based on redis
CN107040455B (en) * 2017-05-27 2021-05-11 北京思特奇信息技术股份有限公司 Instant message communication method and system based on redis
CN107656825A (en) * 2017-09-01 2018-02-02 上海艾融软件股份有限公司 Message treatment method, apparatus and system
CN108965457A (en) * 2018-08-02 2018-12-07 郑州云海信息技术有限公司 A kind of message delivery method of distributed cluster system, device, equipment and medium
CN110968431A (en) * 2018-09-28 2020-04-07 阿里巴巴集团控股有限公司 Message processing method, device and equipment
CN110968431B (en) * 2018-09-28 2023-06-20 阿里巴巴集团控股有限公司 Message processing method, device and equipment
CN111225012A (en) * 2018-11-27 2020-06-02 阿里巴巴集团控股有限公司 Transaction processing method, device and equipment
CN113448757A (en) * 2021-08-30 2021-09-28 阿里云计算有限公司 Message processing method, device, equipment, storage medium and system
CN113448757B (en) * 2021-08-30 2022-02-01 阿里云计算有限公司 Message processing method, device, equipment, storage medium and system

Similar Documents

Publication Publication Date Title
CN105242975A (en) Message transmission method and message middleware
CN101163139B (en) Method and equipment for refusing SIP message of redundancy retransmission
CN103220206B (en) Message sending method and device and message receiving method and device
CN105580334B (en) A kind of data transmission method, terminal and server
CN102946376B (en) Method for implementing asynchronous communication
CN109660451A (en) A kind of method, apparatus and messaging system sending message
CN101507318B (en) Radio communication device and method used in mobile communication system
CN107835102B (en) Method for decomposing protocol characteristics and decomposing fuzzy test
CN103780363A (en) Apparatus and method for retransmitting message
CN104980450A (en) Message transmission method and system and message-oriented middleware
CN106407065A (en) Password keyboard USB communication abnormality recovery method and system
US7995517B2 (en) System and method for transmitting units of messages in a mobile communication system
CN102271315B (en) Short message enhancement function realization method and device
CN102006564A (en) Message intercommunication method and convergence service system
CN115038115A (en) Data transmission method, device, electronic equipment, storage medium and product
CN103312753A (en) Communication method and device of Internet of things
CN112187408B (en) Data processing method, system, device, storage medium and processor
CN109067503A (en) A kind of data repeating method and device
CN114584971A (en) Account registration method and device, electronic equipment and storage medium
JPH1070523A (en) Method and equipment for packet transmission
CN111416889B (en) Communication method and system adapted through GATT and exception handling
CN101594596B (en) Method for processing short message memory available notice message and mobile terminal
CN102237993A (en) MMS (multimedia message) receiving/transmission retry method and device
CN105634692A (en) Data packet transmitting method and receiving method based on UDP protocol
CN101127585A (en) A retransmission mechanism for ISDN user-network interface data link layer

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20160113

WD01 Invention patent application deemed withdrawn after publication