CN105141505A - Message passing tracking method and device in instant messaging system - Google Patents

Message passing tracking method and device in instant messaging system Download PDF

Info

Publication number
CN105141505A
CN105141505A CN201510527217.2A CN201510527217A CN105141505A CN 105141505 A CN105141505 A CN 105141505A CN 201510527217 A CN201510527217 A CN 201510527217A CN 105141505 A CN105141505 A CN 105141505A
Authority
CN
China
Prior art keywords
message
service module
mark
api calls
message transmission
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
CN201510527217.2A
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201510527217.2A priority Critical patent/CN105141505A/en
Publication of CN105141505A publication Critical patent/CN105141505A/en
Pending legal-status Critical Current

Links

Landscapes

  • Computer And Data Communications (AREA)

Abstract

The invention proposes a method for tracking a message passed among a plurality of service modules in an instant messaging system. The method comprises the following steps of: intercepting the message with regards to at least one service module in the plurality of service modules before the message is passed to the corresponding service module; acquiring identification of the message; recording the identification of the message and the identification of the service module so as to indicate that the message can reach the service module. The invention also proposes a device for tracking the message passed among the plurality of service modules in the instant messaging system.

Description

Message Transmission tracking in instantaneous communication system and equipment
Technical field
The present invention relates to instant messaging field, more specifically, relate to the Message Transmission tracking in instantaneous communication system and equipment.
Background technology
In instantaneous communication system (such as: Tencent QQ, Jingdone district rub-a-dub rub-a-dub), a piece of news arrives the recipient of message from the sender of message, the transmission between multiple service modules that usually can comprise at least one application between this.The whole realization mode that message is transmitted between each service module is that API (API) calls.Such as, the API Calls of the RMI mode between different application, the API Calls of the method call mode between the same thread of internal system or different threads.Due to reason or the instantaneous communication system inside of network, the arrival of message 100% usually all cannot be ensured.Therefore, in instant messaging, need a kind of path can followed the tracks of message, identify Message Transmission, and orient the mechanism of information drop-out position.
Existing technical scheme is the logic increasing Message Transmission tracking in the service code in each service module in the mode of hard coded, and the normal service logic of the logical AND that Message Transmission is followed the tracks of is coupled.
But existing technical scheme violates the opening and closing principle of system.And, if message will be transmitted or transmit between multiple application between the multiple service modules in same application, then need to revise the existing service code in application in the respective service module that comprises, this makes existing system become unstable possibly, and Message Transmission trace logic and normal service code also can be caused to produce the relation of close coupling.If no longer need to have followed the tracks of message, also will again the code followed the tracks of for Message Transmission to deleting, reduce the maintainability of system.
The shortcoming of existing technical scheme is, needs the existing code revised in the service module of instantaneous communication system, and makes Message Transmission trace logic and normal business produce close coupling relation, and cause the stability of system to reduce, maintenance cost increases.
Therefore, a kind of technology that can realize the tracking to message when not needing the existing code revised in the service module of instantaneous communication system is needed.
Summary of the invention
For the above-mentioned shortcoming of prior art, the present invention proposes the Message Transmission tracking in instantaneous communication system and equipment, the tracking to message can be realized when not needing the existing code revising instantaneous communication system.
According to an aspect of the present invention, provide a kind of in instantaneous communication system to the method that the message transmitted between multiple service module is followed the tracks of, described method comprises, at least one service module in described multiple service module:
Before Message Transmission to described service module, tackle described message;
Obtain the mark of described message;
Record the mark of described message and the mark of described service module, described service module can be arrived to indicate described message.
When described service module be not Message Transmission last service module of process, described method also comprises: the mark storing described message, therefrom obtains the mark of described message for the obtaining step performed for next service module.
When described service module be Message Transmission first service module of process, the step obtaining the mark of described message comprises: the mark generating described message.
When described service module be not Message Transmission first service module of process, the step obtaining the mark of described message comprises: the mark obtaining the described message that the interception for last service module stores.
Described Message Transmission tracking uses and realizes towards tangent plane programming AOP.
According to a further aspect in the invention, provide a kind of in instantaneous communication system to the equipment that the message transmitted between multiple service module is followed the tracks of, described equipment is used at least one service module in described multiple service module, and comprises:
Blocking apparatus, is configured to: before Message Transmission to service module, tackles described message;
Processing unit, is configured to: process the message that blocking apparatus is tackled, and described processing unit comprises:
Acquiring unit, is configured to: the mark obtaining described message; And
Record cell, is configured to record the mark of described message and the mark of described service module, can arrives described service module to indicate described message.
If described service module be not Message Transmission last service module of process, described processing unit also comprises: memory cell, be configured to the mark storing described message, for the mark therefrom obtaining described message for the processing unit in the described equipment of next service module.
If described service module be Message Transmission first service module of process, described acquiring unit generates the mark of described message.
If described service module be not Message Transmission first service module of process, described acquiring unit is from the mark obtaining the described message stored for the interception of last service module for the memory cell in the described equipment last service module.
Described Message Transmission tracking equipment uses and realizes towards tangent plane programming AOP.
Wherein, the service call type of last service module to described service module comprises one of following API Calls: the API Calls of the same thread in same process; API Calls between different threads in same process; API Calls between different process.
Wherein, the API Calls of the same thread in same process uses the ThreadLocal in Java to realize; API Calls between different threads in same process uses the InheritableThreadLocal in Java to realize; API Calls between different process uses the RpcContext in Dubbo framework to realize.
Technical scheme of the present invention can realize the tracking to Message Transmission when not needing the existing code revised in the service module of instantaneous communication system, and the normal service logic of the logical AND making Message Transmission follow the tracks of is separated, separate coupling, be easy to the respective expansion of the normal service logic of logical AND that Message Transmission follows the tracks of and maintenance.
Accompanying drawing explanation
The exemplary message that Fig. 1 shows in exemplary instantaneous communication system transmits scene;
Fig. 2 shows the structured flowchart of the Message Transmission tracking equipment in instantaneous communication system according to an exemplary embodiment of the present invention;
Fig. 3 shows the flow chart of the Message Transmission tracking in instantaneous communication system according to an exemplary embodiment of the present invention;
Fig. 4 shows the overview that the example message being applied to Fig. 1 transmits the tracking scheme of Message Transmission according to an exemplary embodiment of the present invention of scene;
Fig. 5 shows the process chart of the Message Transmission tracking of transmitting the access point service module in scene according to an exemplary embodiment of the present invention for the example message at Fig. 4;
Fig. 6 shows the process chart of the Message Transmission tracking of transmitting the forwarding service module in scene according to an exemplary embodiment of the present invention for the example message at Fig. 4;
Fig. 7 shows the process chart that the message transmitted in scene for the example message at Fig. 4 according to an exemplary embodiment of the present invention sends the Message Transmission tracking of service module; And
Fig. 8 shows the process chart of the Message Transmission tracking of transmitting the message sink service module in scene according to an exemplary embodiment of the present invention for the example message at Fig. 4.
In the accompanying drawings, important document like similar reference symbol representation class.
Embodiment
The present invention proposes a kind of technology that can realize the tracking to message when not needing the existing code revised in the service module of instantaneous communication system.Exemplary instantaneous communication system is such as based on use Java (a kind of object oriented program language for writing cross-platform software) exploitation and using the RMI of Dubbo framework as the instantaneous communication system of API Calls.As everyone knows, Dubbo is a distributed service framework, and being devoted to provides the RPC of high-performance and transparence (remote procedure call) scheme and SOA (Service Orientation Architecture) to serve resolution.In an exemplary embodiment of the present invention, Dubbo framework is used for the service call in different process, that is, the API Calls of RMI mode.
The exemplary message that Fig. 1 shows in exemplary instantaneous communication system 100 transmits scene, and wherein, message is transmitted by the mode of the method call as one of API Calls mode.For convenience of description, in an exemplary embodiment of the present invention, the way of example called all in method as API Calls is described.
In the example depicted in fig. 1, this exemplary instantaneous communication system 100 comprises such as two different application modules 103 and 105, and they are operationally two independently processes.Such as two modules are comprised: access point service module 1031 and forwarding service module 1033 in application module 103.Such as two modules are comprised: message sends service module 1051 and message sink service module 1053 in application module 105.
In the messaging scenarios that this is exemplary, message sends client 101 by message and sends, the access point service module 1031 comprised in application module 103 and forwarding service module 1033, arriving the message comprised in application module 105 and send service module 1051, is final destination the message sink service module 1053 comprised in application module 105.
At this, application module 103 will call the service that application module 105 provides.Particularly, the access point service module 1031 in application module 103 calls the forwarding service that the forwarding service module 1033 in application module 103 provides in same thread; Next, the message that forwarding service module 1033 is provided by the message transmission service module 1051 that RMI calls in application module 105 sends service; Then, message sends service module 1051 message call in a new thread and receives the message sink service that service module 1053 provides.
It will be understood by those skilled in the art that the messaging scenarios of the instantaneous communication system shown in Fig. 1 is only schematic, and nonrestrictive.In practice, can apply instantaneous communication system of the present invention and can comprise any number of application module according to the actual requirements, each application module can comprise any number of different service module.
Technical scheme of the present invention is intended to solve the Message Transmission tracking problem in such as above-mentioned messaging scenarios.The object that Message Transmission is followed the tracks of is that the record data utilizing Message Transmission to follow the tracks of judge which service module is message be specifically lost in when a user feedback message does not receive.
Key technology according to Message Transmission tracking scheme use of the present invention is AOP (towards tangent plane programming).
Below, by composition graphs 2, the Message Transmission tracking equipment in instantaneous communication system is according to an exemplary embodiment of the present invention described.
Fig. 2 shows the structured flowchart of the Message Transmission tracking equipment in instantaneous communication system according to an exemplary embodiment of the present invention.
Message Transmission tracking equipment 200 is applied in instantaneous communication system according to an exemplary embodiment of the present invention.As previously mentioned, in instantaneous communication system, message arrives the recipient of message from the sender of message, the transmission between multiple service modules that usually can comprise at least one application between this.Such as, if instantaneous communication system only comprises an application, then this application can comprise at least two service modules; If instantaneous communication system comprises multiple application, then each application can comprise at least one service module.Message Transmission tracking equipment 200 can be used for each service module, before arriving each service module in message, utilize corresponding Message Transmission tracking equipment 200 to tackle, thus realize the tracking to Message Transmission.It should be noted that Message Transmission tracking equipment 200 and corresponding service module are independent mutually, and can not be coupled with corresponding service module.
Preferably, Message Transmission tracking equipment 200 uses and realizes towards tangent plane programming AOP.In the preferred embodiment, Message Transmission tracking equipment 200 is also referred to as message and follows the tracks of tangent plane, and this message follows the tracks of the agency that tangent plane is equivalent to called method, follows the tracks of for message.
As shown in Figure 2, Message Transmission tracking equipment 200 can comprise: blocking apparatus 201 and processing unit 203.
Blocking apparatus 201 can be configured to: before Message Transmission to corresponding service module, tackle described message.
Processing unit 203 can be configured to: process the message that blocking apparatus 201 is tackled.Because the mode of message by method call is transmitted, thus when processing unit 203 completes the process to message, call flow can come back to corresponding service module, that is, message can arrive corresponding service module automatically.
Particularly, processing unit 203 can comprise: acquiring unit 2031, for obtaining the mark of described message; And record cell 2033, for the mark of the mark and described service module that record described message, described service module can be arrived to indicate described message.
Preferably, record cell 2033 can by the mark of message (such as, the UUID (general unique identifier) of this message, it is equivalent to the identification card number of this message, for being different from other message), the content of message (such as, type of message, the text message, current time etc. of sender, recipient, message) and corresponding service module mark (such as, the universal class name of service module and corresponding method signature etc.) etc. be recorded in the middle of such as journal file or database, described service module can be arrived to indicate described message.
If the service module that Message Transmission tracking equipment 200 is applied to be Message Transmission first service module of process, first acquiring unit 2031 can generate the mark of described message, namely realizes described acquisition by generating.Preferably, the mark of this message can be the UUID of message (general unique identifier), and it is equivalent to the identification card number of this message, for being different from other message.
In this case, processing unit 203 also comprises: memory cell 2035 (shown in broken lines), is configured to the mark storing described message.Particularly, the mark of described message is stored in its memory headroom by memory cell 2035, therefrom to obtain the mark of described message at the acquiring unit 2031 of the Message Transmission tracking equipment 200 for next service module.That is, if the service module that Message Transmission tracking equipment is applied to be not Message Transmission first service module of process, its acquiring unit 2031 is from the mark obtaining the described message stored for the interception of last service module for the memory cell 2035 the Message Transmission tracking equipment 200 of last service module, such as, by reading the mark obtaining described message from corresponding memory headroom.
The service module that Message Transmission tracking equipment 200 is applied to if be appreciated that be Message Transmission last service module of process, then store the mark of described message without the need to memory cell 2035.In addition, all service modules that Message Transmission tracking equipment 200 is applied to all need the processing unit 203 in its corresponding Message Transmission tracking equipment 200 to comprise the memory cell 2035 of the mark for storing described message.
As previously mentioned, the service call type between two service modules comprises following methods and one of calls: the method call of the same thread in same process; Method call between different threads in same process; And the method call between different process.
Preferably, the method call of the same thread in same process can use the ThreadLocal in Java to realize; Method call between different threads in same process can use the InheritableThreadLocal in Java to realize; Method call between different process can use the RpcContext in Dubbo framework to realize.But, although it will be understood by those skilled in the art that the agreement that RMI uses is not limited thereto in this example to use the RMI of Dubbo agreement exemplarily.The present invention is applicable to the situation of any applicable protocol realization RMI using those skilled in the art to envision.Method call between different process can use the correlation method call function in respective protocol frame to realize.
Fig. 3 shows the flow chart of the Message Transmission tracking in instantaneous communication system according to an exemplary embodiment of the present invention.Preferably, Message Transmission tracking 300 uses and realizes towards tangent plane programming AOP.
See Fig. 3, this Message Transmission tracking 300 can comprise step S301-S307.
In step S301, before Message Transmission to service module, tackle described message.
In step S303, obtain the mark of described message; And in step S305, record the mark of described message and the mark of described service module, described service module can be arrived to indicate described message.
It will be appreciated by those skilled in the art that, step S301 can be performed by the blocking apparatus 201 in Message Transmission tracking equipment 200, particularly, step S303 and step S305 can be performed by the acquiring unit 2031 in processing unit 203 and record cell 2033 respectively.
If the service module that this Message Transmission tracking 300 is applied to be Message Transmission first service module of process, the mark by generating described message in step S303 realizes described acquisition.
In this case, Message Transmission tracking 300 also comprises: step S307 (shown in broken lines), store the mark of described message, for the mark therefrom obtaining described message for the processing unit 203 in the Message Transmission tracking equipment 200 of next service module.Particularly, the mark of described message is stored in its memory headroom by the memory cell 2035 in Message Transmission tracking equipment 200, therefrom to obtain the mark of described message at the acquiring unit 2031 of the Message Transmission tracking equipment 200 for next service module.That is, if the service module that Message Transmission tracking 300 is applied to be not Message Transmission first service module of process, Message Transmission tracking 300 also comprises: from the mark obtaining the described message stored for the interception of last service module for the memory cell 2035 the Message Transmission tracking equipment 200 of last service module, such as, by reading the mark obtaining described message from corresponding memory headroom.
The service module that Message Transmission tracking 300 is applied to if be appreciated that be Message Transmission last service module of process, then store the mark of described message without the need to storing step S307.In addition, all service modules that Message Transmission tracking 300 is applied to all need the storing step S307 of the mark comprised for storing described message.
Fig. 4 shows the overview that the example message being applied to Fig. 1 transmits the tracking scheme of Message Transmission according to an exemplary embodiment of the present invention of scene.
As shown in Figure 4, compared to Figure 1, Message Transmission process each service module before there is a corresponding Message Transmission tracking equipment, also referred to as message follow the tracks of tangent plane.These message is followed the tracks of tangent plane and is used for message and follows the tracks of, and relative to application module 403 and application module 405, it is independently module that these message follows the tracks of tangent plane, can not be coupled with application module 403 and application module 405.Before message arrives each service module, corresponding message all can be had to follow the tracks of tangent plane and to tackle.
In the example depicted in fig. 4, follow the tracks of tangent plane 1 for message, message follows the tracks of tangent plane 1 for for the interception of message of going to access point service module 4031.Before Message Transmission to access point service module 4031, tangent plane 1 will be followed the tracks of by message and tackle.After being tackled by message tracking tangent plane 1, message tracking tangent plane 1 will be recorded message and reach access point service module 4031.If for a certain reason, message does not arrive access point service module 4031, and so message tracking tangent plane 1 also just cannot be tackled, so would not reach access point service module 4031 by recording messages, this is just for the loss investigation of message provides foundation.Similarly, for for go to forward service module 4033 message interception message follow the tracks of tangent plane 2, for for go to message send service module 4051 message interception message follow the tracks of tangent plane 3, for for go to message sink service module 4053 message interception message follow the tracks of tangent plane 4 be also like this.Thus, the record data that Message Transmission can be utilized to follow the tracks of judge which service module is message be specifically lost in.
Below, by composition graphs 5-Fig. 8, transmit scene for the example message of Fig. 4 and illustrate Message Transmission tracking scheme is according to an exemplary embodiment of the present invention how to carry out message tracking when message arrives access point service module 4031, forwarding service module 4033, message transmission service module 4051, message sink service module 4053.Fig. 5-Fig. 8 respectively illustrates the process chart of the Message Transmission tracking scheme transmitting each service module (the access point service module 4031 in application module 403 and the message forwarded in service module 4033 and application module 405 send service module 4051 and message sink service module 4053) in scene for Fig. 4 example message.
Fig. 5 shows according to an exemplary embodiment of the present invention for the process chart that the Message Transmission of the access point service module 4031 in the application module 403 transmitted in the example message of Fig. 4 in scene is followed the tracks of.
The message of access point service module 4031 follows the tracks of the interception mainly utilizing message to follow the tracks of tangent plane 1.As previously mentioned, message is transmitted by the mode of method call, after message sends from message transmission client 401, and first invoked access point service being exactly access point service module 4031 and providing.By the method call that the access point provided for access point service module 4031 is served, message is enable to arrive access point service module 4031.According to an exemplary embodiment of the present, in message (namely, call) arrive access point service module 4031 before, message tracking tangent plane 1 utilizes the tangent plane technology of AOP automatically to tackle this by blocking apparatus 201-1 and calls, and is processed afterwards by processing unit 203-1 in message tracking tangent plane 1.Particularly, because access point service module 4031 is first invoked service, thus first generated the mark of this message by acquiring unit 2031-1 at message tracking tangent plane 1 place, such as, the UUID of message.Then by record cell 2033-1 by the content of the mark of this message, message (such as, type of message, the text message, current time etc. of sender, recipient, message) and access point service module 4031 mark (such as, the universal class name of access point service module and corresponding method signature etc.) etc. be recorded in such as journal file or database, reached access point service module 4031 to indicate this message.In addition, in order to enable next service module obtain the mark of such as message to determine whether message can arrive next service module, message is followed the tracks of tangent plane 1 and is also stored the UUID of message by memory cell 2035-1.Because access point service module 4031 will call the forwarding service forwarding service module 4033 and provide in same thread, so as previously mentioned, the ThreadLocal in Java can be used realize the method call for the same thread in same process.Particularly, the ThreadLocal.set () in Java can be utilized) method call, the mark UUID of message is put into ThreadLocal.When following the tracks of tangent plane 1 place in message and completing the above-mentioned process to message, call flow can come back to access point service module 4031, that is, message can arrive access point service module 4031 automatically.Message sends client 401 by message and is sent to access point service module 4031 and is followed the tracks of tangent plane 1 handling process of tackling as shown in Figure 5 by message, wherein non-italics and solid arrow represent normal flow, and oblique font and dash-dot arrows represent the handling process of Message Transmission tracking scheme according to an exemplary embodiment of the present invention.
Fig. 6 shows according to an exemplary embodiment of the present invention for the process chart that the Message Transmission of the forwarding service module 4033 in the application module 403 transmitted in the example message of Fig. 4 in scene is followed the tracks of.
The message forwarding service module 4033 follows the tracks of the interception mainly utilizing message to follow the tracks of tangent plane 1 and message tracking tangent plane 2.In conjunction with the description for Fig. 5, after the process at message tracking tangent plane 1 place completes, call flow can come back to access point service module 4031.When message is access in after a service module 4031 processes, access point service module 4031 can be transmitted the information to by method call and forward service module 4033 and process.Whether can arrive forwarding service module 4033 smoothly to follow the tracks of this message simultaneously, needing that the mark of message is followed the tracks of tangent plane 1 from message and passing to message tracking tangent plane 2.As previously mentioned, because access point service module 4031 calls the forwarding service forwarding service module 4033 and provide in same thread, so following the tracks of tangent plane 1 place for as described in Fig. 5 in message as front, utilize the ThreadLocal in Java (that is, ThreadLocal.set ()) method call that the mark UUID of message is put into ThreadLocal.Afterwards, when access point service module 4031 calls forwarding service, before calling arrival forwarding service module 4033, message is followed the tracks of tangent plane 2 and is utilized AOP tangent plane technology, by blocking apparatus 201-2, this is called interception to get off, and processes to be followed the tracks of in tangent plane 2 in message by processing unit 203-2.Because be called in same thread, so to follow the tracks of in tangent plane 2 ThreadLocal (that is, ThreadLocal.get ()) method call again can be utilized to take out by following the tracks of in message the message UUID putting into ThreadLocal by memory cell 2035-1 in tangent plane 1 before by acquiring unit 2031-2 in message.Then by record cell 2033-2 by the content of the mark of this message, message (such as, type of message, the text message, current time etc. of sender, recipient, message) and forward service module 4033 mark (such as, forward the universal class name of service module and corresponding method signature etc.) etc. be recorded in such as journal file or database, reached to indicate this message and forwarded service module 4033.In addition, in order to enable next service module obtain the mark of such as message to determine whether message can arrive next service module, message is followed the tracks of tangent plane 2 and is also stored the UUID of message by memory cell 2035-2.Service is sent by utilizing the such as Dubbo framework message that message call transmission service module 4051 provides in different processes owing to forwarding service module 4033, so, can utilize RpcContext in Dubbo (namely, RpcContext.getContext () .setAttachment ()) method call, the UUID of message is put into RpcContext.When following the tracks of tangent plane 2 place in message and completing the above-mentioned process to message, call flow can come back to and forward service module 4033, that is, message automatically can arrive and forward service module 4033.Message forwards service module 4033 and is followed the tracks of tangent plane 2 handling process of tackling as shown in Figure 6 by message being followed the tracks of by message to be passed to by access point service module 4031 after tangent plane 1 is tackled, wherein non-italics and solid arrow represent normal flow, and oblique font and dash-dot arrows represent the handling process of Message Transmission tracking scheme according to an exemplary embodiment of the present invention.
Fig. 7 shows the process chart of the Message Transmission tracking sending service module 4051 according to an exemplary embodiment of the present invention for the message in the application module 405 transmitted in the example message of Fig. 4 in scene.
The message that message sends service module 4051 follows the tracks of the interception mainly utilizing message to follow the tracks of tangent plane 2 and message tracking tangent plane 3.In conjunction with the description for Fig. 6, after the process at message tracking tangent plane 2 place completes, call flow can come back to and forward service module 4033.When message is forwarded after service module 4033 processes, forward service module 4033 and can transmit the information to message by method call and send service module 4051 and process.Whether can arrive message transmission service module 4051 smoothly to follow the tracks of this message simultaneously, needing that the mark of message is followed the tracks of tangent plane 2 from message and passing to message tracking tangent plane 3.As previously mentioned, because forwarding service module 4033 make use of Dubbo framework, the message that message call transmission service module 4051 provides in different processes sends service, so following the tracks of in tangent plane 2 for as described in Fig. 6 in message as front, utilize the RpcContext in Dubbo (that is, RpcContext.getContext () .setAttachment ()) method call that the UUID of message is put into RpcContext.Afterwards, when forwarding service module 4033 message call and sending service, equally before calling arrival message transmission service module 4051, message is followed the tracks of tangent plane 3 and is utilized AOP tangent plane technology, by blocking apparatus 201-3, this is called interception to get off, and processes to be followed the tracks of in tangent plane 3 in message by processing unit 203-3.Because it is called in different processes to make use of Dubbo framework in this embodiment, so to follow the tracks of in tangent plane 3 RpcContext (that is, RpcContext.getContext () .getAttachment ()) method call again can be utilized to take out following the tracks of in message the message UUID putting into RpcContext by memory cell 2035-2 in tangent plane 2 before by acquiring unit 2031-3 in message.Then by record cell 2033-3 by the content of the mark of this message, message (such as, type of message, the text message, current time etc. of sender, recipient, message) and message send service module 4051 mark (such as, message sends the universal class name of service module and corresponding method signature etc.) etc. be recorded in such as journal file or database, reached message to indicate this message and sent service module 4051.In addition, in order to enable next service module obtain the mark of such as message to determine whether message can arrive next service module, message is followed the tracks of tangent plane 3 and is also stored the UUID of message by memory cell 2035-3.That (starting a sub-thread) message call receives service module 4053 in a new thread because message sends service module 4051, so follow the tracks of in tangent plane 3 in message, can utilize the InheritableThreadLocal in Java (that is, InheritableThreadLocal.set ()) method call that the UUID of message is put into InheritableThreadLocal.When following the tracks of tangent plane 3 place in message and completing the above-mentioned process to message, call flow can come back to message and send service module 4051, that is, message can automatically arrive message and send service module 4051.Message is passed to message and sends service module 4051 by forwarding service module 4033 and followed the tracks of tangent plane 3 handling process of tackling as shown in Figure 7 by message being followed the tracks of by message after tangent plane 2 is tackled, wherein non-italics and solid arrow represent normal flow, and oblique font and dash-dot arrows represent the handling process of Message Transmission tracking scheme according to an exemplary embodiment of the present invention.
Fig. 8 shows according to an exemplary embodiment of the present invention for the process chart that the Message Transmission of the message sink service module 4053 in the application module 405 transmitted in the example message of Fig. 4 in scene is followed the tracks of.
The message of message sink service module 4053 follows the tracks of the interception mainly utilizing message to follow the tracks of tangent plane 3 and message tracking tangent plane 4.In conjunction with the description for Fig. 7, after the process at message tracking tangent plane 3 place completes, call flow can come back to message and send service module 4051.After message is processed by message transmission service module 4051, message transmission service module 4051 can transmit the information to message sink service module 4053 by method call and process.Whether can arrive message sink service module 4053 smoothly to follow the tracks of just that message simultaneously, needing that the mark of message is followed the tracks of tangent plane 3 from message and passing to message tracking tangent plane 4.As previously mentioned, because it is that (starting a sub-thread) message call receives service module 4053 in a new thread that message sends service module 4051, so follow the tracks of in tangent plane 3 in message, utilize the InheritableThreadLocal in Java (that is, InheritableThreadLocal.set ()) method call that the UUID of message is put into InheritableThreadLocal.Afterwards, when message sends service module 4051 message call reception service, equally before calling arrival message sink service module 4053, message is followed the tracks of tangent plane 4 and can be utilized AOP tangent plane technology, by blocking apparatus 201-4, this is called interception to get off, and processes to be followed the tracks of in tangent plane 4 in message by processing unit 203-4.Because be called in sub-thread, so to follow the tracks of in tangent plane 4 InheritableThreadLocal (that is, InheritableThreadLocal.get ()) method call again can be utilized to take out following the tracks of in message the message UUID putting into InheritableThreadLocal by memory cell 2035-3 in tangent plane 3 before by acquiring unit 2031-4 in message.Then by record cell 2033-4 by the content of the mark of this message, message (such as, type of message, the text message, current time etc. of sender, recipient, message) and message sink service module 4053 mark (such as, the universal class name of message sink service module and corresponding method signature etc.) etc. be recorded in such as journal file or database, reached message sink service module 4053 to indicate this message.Message sends service module 4051 by message after tangent plane 3 is tackled and is passed to message sink service module 4053 and is followed the tracks of tangent plane 4 handling process of tackling as shown in Figure 8 by message being followed the tracks of by message, wherein non-italics and solid arrow represent normal flow, and oblique font and dash-dot arrows represent the handling process of Message Transmission tracking scheme according to an exemplary embodiment of the present invention.
To transmit in scene although should be appreciated that in above example message, the access point service module 4031 described in application module 403 is in same thread, call forwarding service that the forwarding service module 4033 in application module 403 provides; Forwarding service module 4033 is that the message that the message transmission service module 4051 called in different processes in application module 405 provides sends service; It is that the message sink that message call reception service module 4053 provides in different threads is served that message sends service module 4051, but, three kinds of dissimilar (that is, method calls of the same thread in same process of the service call between this is just intended to service module; Method call between different threads in same process; Method call between different process) to explain respectively, the method call of the same thread in same process uses the ThreadLocal in Java to realize; Method call between different threads in same process uses the InheritableThreadLocal in Java to realize; Method call between different process uses the RpcContext in Dubbo framework to realize.As previously mentioned, although in this example to use the RMI of Dubbo agreement exemplarily, the agreement that RMI uses is not limited thereto.The present invention is applicable to the situation of any applicable protocol realization RMI using those skilled in the art to envision.Method call between different process can use the correlation method call function in respective protocol frame to realize.In actual applications, the type called between service module is can according to belonging to the specific service module of each application and predetermined.
Those skilled in the art should understand, embodiments of the invention can be provided as method, equipment or computer program.Therefore, the present invention can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.And the present invention can adopt in one or more form wherein including the upper computer program implemented of computer-usable storage medium (including but not limited to magnetic disc store and optical memory etc.) of computer usable program code.
The present invention describes with reference to according to the flow chart of the method for the embodiment of the present invention, equipment (system) and computer program and/or block diagram.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block diagram and/or square frame and flow chart and/or block diagram and/or square frame.These computer program instructions can being provided to the processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing device to produce a machine, making the instruction performed by the processor of computer or other programmable data processing device produce device for realizing the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer-readable memory that works in a specific way of vectoring computer or other programmable data processing device, the instruction making to be stored in this computer-readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, make on computer or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computer or other programmable devices is provided for the step realizing the function of specifying in flow chart flow process or multiple flow process and/or block diagram square frame or multiple square frame.
Obviously, those skilled in the art can carry out various change and modification to the present invention and not depart from the spirit and scope of the present invention.Like this, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.

Claims (16)

1. in instantaneous communication system to the method that the message transmitted between multiple service module is followed the tracks of, described method comprises, at least one service module in described multiple service module:
Before Message Transmission to described service module, tackle described message;
Obtain the mark of described message;
Record the mark of described message and the mark of described service module, described service module can be arrived to indicate described message.
2. method according to claim 1, if wherein described service module be not Message Transmission last service module of process, described method also comprises: the mark storing described message, therefrom obtains the mark of described message for the obtaining step performed for next service module.
3. method according to claim 2, if wherein described service module be Message Transmission first service module of process, the step obtaining the mark of described message comprises: the mark generating described message.
4. method according to claim 2, if wherein described service module be not Message Transmission first service module of process, the step obtaining the mark of described message comprises: the mark obtaining the described message that the interception for last service module stores.
5. method according to claim 1, if wherein described service module be Message Transmission last service module of process, the step obtaining the mark of described message comprises: the mark obtaining the described message that the interception for last service module stores.
6. method according to claim 1, wherein the service call type of last service module to described service module comprises one of following API API Calls: the API Calls of the same thread in same process; API Calls between different threads in same process; API Calls between different process.
7. method according to claim 6, the API Calls of the same thread wherein in same process uses the ThreadLocal in Java to realize; API Calls between different threads in same process uses the InheritableThreadLocal in Java to realize; API Calls between different process uses the RpcContext in Dubbo framework to realize.
8. Message Transmission tracking according to claim 1, its use realizes towards tangent plane programming AOP.
9. in instantaneous communication system to the equipment that the message transmitted between multiple service module is followed the tracks of, described equipment is used at least one service module in described multiple service module, and comprises:
Blocking apparatus, is configured to: before Message Transmission to corresponding service module, tackle described message;
Processing unit, is configured to: process the message that blocking apparatus is tackled, and described processing unit comprises:
Acquiring unit, is configured to: the mark obtaining described message; And
Record cell, is configured to: record the mark of described message and the mark of described service module, can arrive described service module to indicate described message.
10. equipment according to claim 9, if wherein described service module be not Message Transmission last service module of process, described processing unit also comprises: memory cell, be configured to the mark storing described message, for the mark therefrom obtaining described message for the processing unit in the described equipment of next service module.
11. equipment according to claim 10, if wherein described service module be Message Transmission first service module of process, described acquiring unit generates the mark of described message.
12. equipment according to claim 10, if wherein described service module be not Message Transmission first service module of process, described acquiring unit is from the mark obtaining the described message stored for the interception of last service module for the memory cell the described equipment of last service module.
13. equipment according to claim 9, if wherein described service module be Message Transmission last service module of process, described acquiring unit is from the mark obtaining the described message stored for the interception of last service module for the memory cell the described equipment of last service module.
14. equipment according to claim 9, wherein the service call type of last service module to described service module comprises one of following API API Calls: the API Calls of the same thread in same process; API Calls between different threads in same process; API Calls between different process.
15. equipment according to claim 14, the API Calls of the same thread wherein in same process uses the ThreadLocal in Java to realize; API Calls between different threads in same process uses the InheritableThreadLocal in Java to realize; API Calls between different process uses the RpcContext in Dubbo framework to realize.
16. equipment according to claim 9, its use realizes towards tangent plane programming AOP.
CN201510527217.2A 2015-08-25 2015-08-25 Message passing tracking method and device in instant messaging system Pending CN105141505A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510527217.2A CN105141505A (en) 2015-08-25 2015-08-25 Message passing tracking method and device in instant messaging system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510527217.2A CN105141505A (en) 2015-08-25 2015-08-25 Message passing tracking method and device in instant messaging system

Publications (1)

Publication Number Publication Date
CN105141505A true CN105141505A (en) 2015-12-09

Family

ID=54726721

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510527217.2A Pending CN105141505A (en) 2015-08-25 2015-08-25 Message passing tracking method and device in instant messaging system

Country Status (1)

Country Link
CN (1) CN105141505A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112104707A (en) * 2020-08-25 2020-12-18 北京达佳互联信息技术有限公司 Data reporting method, device and equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1825985A (en) * 2005-02-25 2006-08-30 华为技术有限公司 Message tracking method for distributed managing system
CN101394314A (en) * 2008-10-20 2009-03-25 北京邮电大学 Fault positioning method for Web application system
CN103036895A (en) * 2012-12-20 2013-04-10 北京奇虎科技有限公司 Method and system for state tracking
CN104219316A (en) * 2014-09-12 2014-12-17 微梦创科网络科技(中国)有限公司 Method and device for processing call request in distributed system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1825985A (en) * 2005-02-25 2006-08-30 华为技术有限公司 Message tracking method for distributed managing system
CN101394314A (en) * 2008-10-20 2009-03-25 北京邮电大学 Fault positioning method for Web application system
CN103036895A (en) * 2012-12-20 2013-04-10 北京奇虎科技有限公司 Method and system for state tracking
CN104219316A (en) * 2014-09-12 2014-12-17 微梦创科网络科技(中国)有限公司 Method and device for processing call request in distributed system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
GUNJAN KHANNA ETAL: "《distributed diagnosis of failure in a three tier e-commerce system》", 《26TH IEEE INTERNATIONAL SYMPOSIUM ON RELIABLE DISTRIBUTED SYSTEMS》 *
MIKE Y CHEN ETAL: "《pinpoint:problem determination in large,dynamic internet services》", 《PROCEEDINGS OF THE INTERNATIONAL CONFERERENCE ON DEPENDABLE SYSTEMS AND NETWORKS》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112104707A (en) * 2020-08-25 2020-12-18 北京达佳互联信息技术有限公司 Data reporting method, device and equipment

Similar Documents

Publication Publication Date Title
US11777885B2 (en) Encoding data in email headers
US11929970B2 (en) Methods, systems and recording mediums for providing messenger service having specific condition
JP6164747B2 (en) Method for flow control in a collaborative environment and for reliable communication
CN105684382A (en) Packet control method, switch and controller
US10666509B2 (en) Transporting multi-destination networking traffic by sending repetitive unicast
US10135763B2 (en) System and method for secure and efficient communication within an organization
CN104901815A (en) Grouping method for user terminals, conference server and conference system
CN103491156A (en) Method and system for enabling circles and groups to be synchronous based on converged communication
CA2923896A1 (en) Email webclient notification queuing
US9557883B1 (en) Preventing modification of an email
US20140365583A1 (en) Managing a messaging state across multiple clients
CN105141505A (en) Message passing tracking method and device in instant messaging system
JP2019527490A (en) Method, system, and computer program product for selectively adapting and transmitting message data
US20160050235A1 (en) Flexible Server Architecture With Ability To Dynamically Change Gateway Communication Channels
US11870746B2 (en) Method for chatting messages by topic based on subscription channel reference in server and user device
US10075400B2 (en) Transmission and presentation of private content in electronic messages
JP6074223B2 (en) Information processing apparatus, control method therefor, and program
US20140280641A1 (en) Email as a transport mechanism for activity stream posting
CN104427003B (en) Transmission device, transfer approach and relay system
KR101804054B1 (en) Message Server Managing Message And Method of Thereof
US11743218B2 (en) Message capture in a multi channel communication environment
US8762706B2 (en) Computer systems, methods and program product for multi-level communications
Mao et al. 5G Enhancement Based on User Plane Service Architecture
KR101350477B1 (en) A method for sending and receiving bulk data through m2m architecture
CN113924587A (en) System and method for preventing distribution of unacceptable accessories

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20151209

RJ01 Rejection of invention patent application after publication