Message routing method, device, system, equipment and medium
By introducing a routing subsystem into the application debugging system to receive and route debugging request messages, the problem of low application debugging efficiency in the existing technology is solved, and the efficient function of simultaneous debugging by multiple users is realized.
Patent Information
- Application Number
- CN202010858123.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-05-26
- Filing Date
- 2020-08-24
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2040-08-24
AI Technical Summary
The prior art is less efficient in the debugging process of application and is difficult to meet business needs, especially when multiple users are debugging simultaneously.
Provide a message routing method that receives debugging request messages through the routing subsystem in the application debugging system and routes them to the corresponding sub-application module agent to realize the function of simultaneous debugging by multiple users.
It improves the debugging efficiency of applications, supports multiple users to debug applications at the same time, and enhances the reliability and availability of the system.
Smart Images

Figure CN113726834B_ABST
Abstract
Description
[0001] This application claims priority to a Chinese patent application filed with the State Intellectual Property Office of China on May 26, 2020, with application number 202010456122.7 and application name “An application debugging method, device, equipment and medium”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of application development technology, and in particular to a message routing method, apparatus, system, device, and computer-readable storage medium. Background Art
[0003] An application is a collection of computer programs written for a specific user purpose. From project establishment to delivery to customers, applications usually go through multiple stages, including development, testing, and launch. In each stage of development, testing, and launch, corresponding environments are often configured, such as development environment, testing environment, and application environment (also called production environment).
[0004] Developers often need to debug applications. Application debugging includes detecting errors in the application program code manually or by compiling, and then correcting the program code according to the errors found during the debugging process. At present, the industry usually debugs applications in an integrated development environment (IDE) to debug the application program code in a development environment.
[0005] However, the debugging efficiency of this debugging method is relatively low and it is difficult to meet business needs. Summary of the invention
[0006] The present application provides a message routing method, which can realize the safe and reliable transmission of debugging messages between the application debugging system and the application, so as to directly debug the application and improve the debugging efficiency. Moreover, the method supports multiple users to debug the application at the same time, further improving the debugging efficiency. The present application also provides a device, system, equipment, computer-readable storage medium and computer program product corresponding to the above method.
[0007] In a first aspect, the present application provides a method for message routing. The method is specifically performed by an application debugging system. The application debugging system is used to debug applications running in a production environment. An application generally includes multiple sub-application modules. A sub-application module refers to a functional module that implements one or more functions through a computer-executable code block, and a sub-application module may be one or more source code files. When the application is an application based on a micro services architecture (MSA), the sub-application module may also be one or more microservices.
[0008] The application debugging system includes a routing subsystem and at least one interactive subsystem. The routing subsystem receives at least one debugging request message sent by at least one interactive subsystem, each debugging request message indicating a request to debug a sub-application module of the application, and then the routing subsystem routes the at least one debugging request message to an agent corresponding to the at least one sub-application module requested to be debugged.
[0009] The agent corresponding to each sub-application module is a code block deployed in the production environment at the same time as the sub-application module. This code block is used to proxy the sub-application module to interact with the outside world and debug the sub-application module at runtime. Among them, the sub-application module (such as a microservice) generates a process at runtime, and the agent of the sub-application module is essentially equivalent to an independent thread hosted in the process at runtime.
[0010] The routing subsystem routes at least one debugging request message generated by different users to the agent of at least one sub-application module, which is equivalent to routing to at least one sub-application module. This can directly debug the application and improve debugging efficiency. In addition, the method can support multiple users to debug one or more sub-application modules at the same time, further improving debugging efficiency.
[0011] In some possible implementations, each interactive subsystem generates a corresponding debugging request message according to the debugging operation of each user, thereby enabling multiple users to debug the application (specifically the same sub-application module or different sub-application modules of the application) at the same time, thereby improving debugging efficiency.
[0012] In some possible implementations, the user's debugging operations include: debugging selection and debugging start operations performed by the user through a graphical user interface (GUI) provided by the interactive subsystem, or debugging selection and debugging start operations sent by the user through a command user interface (CUI) provided by the interactive subsystem.
[0013] Among them, the sub-application modules of the application are presented to the user through the GUI so that the user can select the sub-application module for debugging, which can improve the user experience. Of course, the user can also directly input the identifier of the sub-application module requested for debugging and the corresponding command through the CUI to start debugging, which can simplify user operations and improve debugging efficiency.
[0014] In some possible implementations, the production environment includes at least one node. Each node has a node agent, also called a host agent. The host agent is a code block deployed in the production environment at the same time as the application. The host agent is used to forward messages from the sub-application module on the node or forward messages to the sub-application module on the node. When the host agent is running, a process can be generated. The program code corresponding to the process can be deployed to the node when the code block included in the sub-application module of the application is deployed to the node. When the process of the sub-application module on the node is started, the host agent is also started.
[0015] In this way, the routing subsystem can transmit the at least one debugging request message to the host agent of the node where the at least one sub-application module requested for debugging is located, and then transmit the at least one debugging request message to the agent corresponding to the at least one sub-application module requested for debugging through the host agent, thereby realizing many-to-many message routing and providing assistance for multiple users to debug applications at the same time.
[0016] In some possible implementations, the routing subsystem includes multiple debugging agents. The debugging agent can be a proxy based on the debug adapter protocol (DAP). The debugging agent is essentially a piece of program code, which generates a process or thread when executed. For the convenience of description, the debugging agent based on DAP can be called a DAP proxy, or simply a proxy.
[0017] At least one debugging request message includes a first debugging request message. The first debugging request message may be any one of the at least one debugging request message. When the routing subsystem routes the first debugging request message, the proxy (specifically the first proxy) that receives the first debugging request message may broadcast the first debugging request message to the multiple proxies, and then the proxy (specifically the second proxy) in the routing subsystem that is long-connected to the host agent of the node where the first sub-application module requested for debugging is located transmits the first debugging request message to the host agent of the node where the first sub-application module requested for debugging is located.
[0018] This ensures that when the agents of the interactive subsystem and sub-application modules are connected to different proxies, debug messages can be transmitted safely and reliably between the interactive subsystem and sub-application modules. In addition, when some proxies go offline, they can be reconnected to other proxies to ensure that debug messages can be correctly transmitted to the corresponding agents or interactive subsystems.
[0019] In some possible implementations, a long connection is pre-established between the second proxy and the host agent of the node where the sub-application module requesting debugging is located. For example, a web socket long connection is established between the second proxy and the host agent of the node where the sub-application module is located. In this way, the routing subsystem can transmit the debugging request message through the long connection between the second proxy and the host agent. Among them, the above-mentioned long connection can realize continuous transmission of the debugging request message, thereby improving the debugging efficiency.
[0020] In some possible implementations, the routing subsystem includes multiple debugging agents. The production environment includes at least one node. Before the routing subsystem receives the debugging request message sent by the at least one interactive subsystem, the host agent of the node where at least one sub-application module of the application is located may also send a connection request message to at least one proxy in the routing subsystem, and the proxy may establish a long connection with the host agent according to the connection request message.
[0021] Among them, the host agent can randomly select at least one proxy to send a connection request message and establish a long connection with at least one proxy. When the host agent establishes a long connection with multiple proxies, one of the long connections can be used as the main connection, and the remaining long connections can be used as backup connections. When the main connection fails, the backup connection can be enabled to transmit debug messages to ensure that the messages can be transmitted normally, thereby improving the availability of the entire system.
[0022] In some possible implementations, the agent of at least one sub-application module receives a debugging request message, and can also start debugging of at least one sub-application module according to the debugging request message, and generate at least one debugging response message. The routing subsystem receives at least one debugging response message from the agent of at least one sub-application module requesting debugging, and the routing subsystem routes the at least one debugging response message to the corresponding interaction subsystem.
[0023] In this way, the routing subsystem can route at least one debugging response message to the corresponding interaction subsystem, thereby enabling multiple users to debug the application at the same time, thereby improving debugging efficiency.
[0024] In a second aspect, the present application provides a message routing device. The device includes:
[0025] A communication unit, configured to receive at least one debugging request message sent by at least one interactive subsystem, each debugging request message indicating a sub-application module of a requested debugging application;
[0026] The routing unit is used to route the at least one debugging request message to an agent corresponding to at least one sub-application module requesting debugging.
[0027] In some possible implementations, the application is deployed in a production environment, the production environment includes at least one node, and the routing unit is specifically used to:
[0028] Transmitting the at least one debugging request message to a node agent of a node where the at least one sub-application module requested to be debugged is located;
[0029] The at least one debugging request message is transmitted through the node agent to an agent corresponding to at least one sub-application module requesting debugging.
[0030] In some possible implementations, the apparatus includes a plurality of debugging agents, the at least one debugging request message includes a first debugging request message, and the routing unit is specifically configured to:
[0031] broadcasting the first debugging request message to the multiple debugging agents through the first debugging agent;
[0032] The first debugging request message is transmitted to the node agent of the node where the sub-application module requesting debugging is located through the second debugging agent.
[0033] In some possible implementations, a long connection is pre-established between the second debugging agent and a node agent of a node where the sub-application module requesting debugging is located.
[0034] In some possible implementations, the device includes a plurality of debugging agents, the application is deployed in a production environment, the production environment includes at least one node, and the device further includes a connection unit;
[0035] The communication unit is also used for:
[0036] Before receiving the debugging request message sent by the at least one interactive subsystem, receiving, through at least one debugging agent, a connection request message sent by a node agent of a node where at least one sub-application module of the application is located;
[0037] The connection unit is specifically used for:
[0038] A long connection with the node agent is established through the at least one debugging agent.
[0039] In some possible implementations, the communication unit is further configured to:
[0040] receiving at least one debugging response message sent by an agent of at least one sub-application module requesting debugging;
[0041] The routing unit is also used for:
[0042] The at least one debugging response message is routed to a corresponding interaction subsystem.
[0043] In a third aspect, the present application provides an application debugging system. The application debugging system includes a routing subsystem and at least one interaction subsystem, and the application debugging system is used to debug applications running in a production environment;
[0044] The interaction subsystem is used to send a debugging request message to the routing subsystem, each debugging request message indicating a request to debug a sub-application module of the application;
[0045] The routing subsystem is used to route at least one debugging request message sent by the at least one interactive subsystem to an agent corresponding to at least one sub-application module requesting debugging.
[0046] In some possible implementations, each interaction subsystem is used to generate a corresponding debugging request message according to the debugging operation of the respective user.
[0047] In some possible implementations, the user's debugging operations include: debugging selection and debugging start operations performed by the user through the graphical user interface GUI provided by the interactive subsystem, or debugging selection and debugging start operations sent by the user through the command user interface CUI provided by the interactive subsystem.
[0048] In some possible implementations, the production environment includes at least one node, and the routing subsystem is specifically used for:
[0049] Transmitting the at least one debugging request message to a node agent of a node where the at least one sub-application module requested to be debugged is located;
[0050] The at least one debugging request message is transmitted through the node agent to an agent corresponding to at least one sub-application module requesting debugging.
[0051] In some possible implementations, the routing subsystem includes a plurality of debugging agents, the at least one debugging request message includes a first debugging request message, and the routing subsystem is specifically configured to:
[0052] broadcasting the first debugging request message to the multiple debugging agents through the first debugging agent;
[0053] The first debugging request message is transmitted to the node agent of the node where the sub-application module requesting debugging is located through the second debugging agent.
[0054] In some possible implementations, a long connection is pre-established between the second debugging agent and a node agent of a node where the sub-application module requesting debugging is located.
[0055] In some possible implementations, the routing subsystem includes a plurality of debugging agents, the production environment includes at least one node, and the routing subsystem is further configured to:
[0056] Before receiving the debugging request message sent by the at least one interactive subsystem, receiving, through at least one debugging agent, a connection request message sent by a node agent of a node where at least one sub-application module of the application is located;
[0057] A long connection with the node agent is established through the at least one debugging agent.
[0058] In some possible implementations, the routing subsystem is further configured to:
[0059] receiving at least one debugging response message sent by an agent of at least one sub-application module requesting debugging;
[0060] The at least one debugging response message is routed to a corresponding interaction subsystem.
[0061] In a fourth aspect, the present application provides a computing device. The computing device includes a processor and a memory. The processor and the memory communicate with each other. The processor is used to execute instructions stored in the memory so that the computing device performs the message routing method in the first aspect or any implementation of the first aspect.
[0062] In a fifth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, wherein the instructions instruct a computing device to execute the message routing method described in the first aspect or any one of the implementations of the first aspect.
[0063] In a sixth aspect, the present application provides a computer program product comprising instructions. When the computer program product is executed on a computing device, the computing device is enabled to execute the message routing method described in the first aspect or any one of the implementations of the first aspect.
[0064] Based on the implementations provided in the above aspects, this application can also be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] In order to more clearly illustrate the technical method of the embodiments of the present application, the drawings required for use in the embodiments are briefly introduced below.
[0066] Figure 1 An application scenario diagram of a message routing method provided in an embodiment of the present application;
[0067] Figure 2A A system architecture diagram of a message routing method provided in an embodiment of the present application;
[0068] Figure 2B A system architecture diagram of a message routing method provided in an embodiment of the present application;
[0069] Figure 2C A system architecture diagram of a message routing method provided in an embodiment of the present application;
[0070] Figure 3 A flowchart of a message routing method provided in an embodiment of the present application;
[0071] Figure 4 An interactive flow chart of a message routing method provided in an embodiment of the present application;
[0072] Figure 5 A schematic diagram of the structure of a message routing device provided in an embodiment of the present application;
[0073] Figure 6 A schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0074] The terms "first" and "second" in the embodiments of the present application are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features.
[0075] First, some technical terms involved in the embodiments of the present application are introduced.
[0076] An application (APP) is a collection of computer programs written for a specific purpose of a user. It can be a single application or a collection of multiple applications. For example, in the office field, an application can be a single text editing application or an application composed of a text editing application, a table editing application, and a graphic editing application.
[0077] An application usually includes multiple sub-application modules. A sub-application module refers to a functional module that implements one or more functions through a computer-executable code block. A sub-application module can be one or more source code files. The sub-application module can be run in a production environment to provide services. Among them, the production environment refers to the environment where the service is officially provided. The production environment includes at least one node, which refers to a computing node with computing capabilities such as a server or a terminal computing device.
[0078] For complex applications with many functions, developers can use microservices architecture (MSA) for development to improve development efficiency. Among them, microservices architecture refers to splitting the functional modules of the application into independent microservices. A microservice is a collection of one or a group of relatively small and independent functional units. Microservices interact with each other through interface calls. In this way, the decoupling of the various functional modules of the application can be achieved. When the application needs to add, delete or modify functions, developers can add, delete or modify the corresponding microservices. The sub-application module can also be one or more microservices. Microservices run in the production environment to provide corresponding services.
[0079] For applications that have been deployed in a production environment, if there are problems such as abnormal operation, it is usually necessary to debug the application. Debugging refers to checking the application program code for errors through various means such as single-step execution, setting breakpoints, and printing variable contents.
[0080] The related art debugging method for applications deployed in a production environment is usually to load the program code of the application into an integrated development environment (IDE), debug the program code of the application locally in the development environment through the IDE, and after local debugging, solve the identified problems before redeploying the application online. The debugging efficiency of the application is greatly affected by the need to reproduce the exceptions generated by the application running in the production environment in the development environment, load the program code of the application into the IDE for local debugging, and redeploy the debugged application online.
[0081] Based on this, the present application proposes a method for debugging an application directly in a production environment. The method is executed by an application debugging system. For applications deployed in a production environment to be debugged, the application debugging system receives the identifiers of multiple sub-application modules input or selected by the user, debugs the code blocks of the multiple sub-application modules according to the identifiers of the multiple sub-application modules, and then presents the debugging results to the user. The method supports users to select multiple sub-application modules to be debugged at one time, debugs multiple sub-application modules of the application, and improves the debugging efficiency of the application. Moreover, users can debug directly in a production environment without loading the program code into the IDE for local debugging, and without redeploying the debugged application online, further improving the debugging efficiency.
[0082] Among them, the application debugging system also supports multiple users to debug the same sub-application module or different sub-application modules of the application at the same time. During the debugging process, the application debugging system often needs to transmit debugging messages generated by multiple users debugging sub-application modules, such as debugging request messages. How to safely and reliably transmit debugging request messages for different users to debug different sub-application modules to the corresponding sub-application modules has become a key issue of concern in the industry.
[0083] In view of this, an embodiment of the present application provides a message routing method. The method can be executed by an application debugging system. The application debugging system can be used to debug applications running in a production environment. The application debugging system includes a routing subsystem and at least one interaction subsystem.
[0084] The routing subsystem receives at least one debugging request message sent by at least one interactive subsystem, each debugging request message indicates a sub-application module of the application requested for debugging, and then the routing subsystem routes at least one debugging request message to an agent corresponding to at least one sub-application module requested for debugging.
[0085] The agent corresponding to each sub-application module is a code block deployed in the production environment at the same time as the application. This code block is used to proxy the sub-application module to interact with the outside world and debug the sub-application module at runtime. Among them, the sub-application module (such as a microservice) generates a process at runtime, and the agent of the sub-application module is essentially equivalent to an independent thread hosted in the process at runtime. The routing subsystem routes at least one debugging request message generated by different users for debugging to the agent of at least one sub-application module, which is equivalent to routing to at least one sub-application module. In this way, multiple users can debug multiple sub-application modules, improving debugging efficiency.
[0086] Furthermore, when the application debugging system debugs the sub-application module of the application, it will not block the above process, but directly interact through the thread hosted in the above process, so that the sub-application module of the application can be debugged directly in the production environment.
[0087] In order to make the technical solution of the present application clearer and easier to understand, the application scenario of the message routing method provided in the embodiment of the present application is introduced below with reference to the accompanying drawings.
[0088] See also Figure 1 The application scenario diagram of the message routing method shown in FIG. In this scenario, the application debugging system 100 is used to debug at least one application 200 deployed in a data center 300. The data center 300 provides a production environment, and the application 200 is deployed in the production environment. The application 200 includes multiple sub-application modules, and each sub-application module includes a code block for implementing the function of the application 200.
[0089] The sub-application modules of the application 200 may be distributedly deployed on at least one node of the data center 300. For example, Figure 1 In the example, the n sub-application modules of application 200 are distributedly deployed on k nodes (also referred to as hosts) in the data center, where k is less than or equal to n. It should be noted that the sub-application modules can be deployed directly on the nodes, that is, deployed in the physical machine, or deployed in the virtual machine or container on the node. When each sub-application module of application 200 is deployed in an independent container, the sub-application modules running in the container can interact through the container's interface.
[0090] Each sub-application module has an agent. The agent can be created by code injection. Code injection is a technique for inserting independently running code into a target process and making it run. Code injection can generally be implemented by configuring environment variables. Taking the Java platform as an example, the environment variable can be JAVA_TOOL_OPTIONS. By assigning the environment variable to the name of the code file to be inserted, such as export JAVA_TOOL_OPTIONS="-agent-lib:hprof", when the process of the sub-application module (such as a microservice) is started, the code in the inserted code file is written to the virtual memory space of the above process, and the thread corresponding to the inserted code is also started with the start of the process. The thread can run until the host process is terminated.
[0091] The application debugging system 100 includes a routing subsystem 104 and at least one interactive subsystem 102. Each interactive subsystem 102 in the at least one interactive subsystem 102 can generate a corresponding debugging request message according to the debugging operation of the respective user. Each debugging request message indicates a sub-application module of the application 200 that is requested to be debugged. The routing subsystem 104 receives at least one debugging request message sent by at least one interactive subsystem 102, and routes the at least one debugging request message to an agent corresponding to at least one sub-application module that is requested to be debugged.
[0092] In some possible implementations, each node where a sub-application module is located has a node agent. The node agent is also called a host agent. The host agent is a code block deployed in the production environment at the same time as the application 200. The host agent is used to forward messages from the sub-application module on the node or forward messages to the sub-application module on the node. When the host agent is running, a process can be generated. The program code corresponding to the process can be deployed to the node when the code block included in the sub-application module of the application 200 is deployed to the node. When the process of the sub-application module on the node is started, the host agent is also started.
[0093] Based on this, when routing debugging request messages, the routing subsystem 104 can first transmit at least one debugging request message to the host agent of the node where at least one sub-application module requested for debugging is located, and then the routing subsystem 104 transmits at least one debugging request message to the agent corresponding to the at least one sub-application module requested for debugging through the host agent.
[0094] In some possible implementations, the routing subsystem 104 includes at least one debugging agent. The debugging agent may be an agent based on the debug adapter protocol (DAP). The debugging agent is essentially a piece of program code, which generates a process or thread when executed. For ease of description, the embodiments of the present application may refer to the debugging agent based on DAP as a DAP proxy, or simply as a proxy.
[0095] Figure 1The illustrated embodiment uses the example that the routing subsystem 104 includes multiple proxies. The host agent of the node where the sub-application module of the application 200 is located can establish a long connection with a proxy during initialization. For example, the host agent can establish a web socket long connection with a proxy. In this way, the routing subsystem 104 can transmit a debugging request message to the host agent through the long connection pre-established between the proxy and the host agent, and then transmit the debugging request message to the agent corresponding to the sub-application module requesting debugging through the hostagent. In some embodiments, the hostagent can also establish a long connection with multiple proxies during initialization. One of the long connections serves as the main connection, and the remaining long connections serve as backup connections, thereby ensuring the reliability of message routing.
[0096] In some possible implementations, the interaction subsystem 102 may include an interaction module and a debug adapter. The interaction module is used to provide a user interface, such as a graphical user interface (GUI) or a command user interface (CUI). Users can perform debugging operations through the above user interface.
[0097] For example, the interaction module presents the sub-application modules of the application 200 to the user through the GUI, and the user can perform debugging selection and debugging start operations through the GUI. Among them, the debugging selection includes selecting the sub-application module to be debugged. In some embodiments, the debugging selection may also include the debugging type, such as breakpoint debugging, single-step debugging, variable tracking, etc. For another example, the user may also directly send the debugging selection and debugging start operations in the form of commands through the CUI.
[0098] The interaction module may be an integrated development environment (IDE) that provides application debugging functions. The IDE can not only be used to edit the program code of the application 200 and debug the program code in the development process, but also debug the remote application 200 that has been launched. The interaction module may also be other interaction modules that can provide the function of debugging the online application 200, such as a browser loaded with a user interface for debugging the application 200 or an interaction module dedicated to application debugging. For ease of description, the following text takes the interaction module as an IDE for example.
[0099] The debug adapter is essentially a piece of program code. The program code can be provided to users in the form of a plug-in, and users can install the plug-in in the IDE. When the plug-in is executed, a service process independent of the IDE and the programming language framework is generated. The debug adapter service process serves as an intermediate layer between the IDE and the proxy, and is used to listen to debugging operations from the IDE and establish a long connection with the proxy, such as a websocket connection. The long connection can be used to transmit debugging messages, such as debugging request messages.
[0100] Figure 1 The application debugging system 100 shown has multiple deployment methods, and the deployment methods of the application debugging system 100 are described in detail below.
[0101] In some implementations, the various subsystems of the application debugging system 100 may be deployed in different environments in a distributed manner. Figure 2A As shown, the interaction subsystem 102 can be deployed in a terminal computing device (such as a user terminal such as a desktop computer or a laptop computer), and the routing subsystem 104 can be deployed in a cloud computing cluster (including at least one cloud computing device, such as a cloud server, etc.). When the routing subsystem 104 includes multiple proxies, the multiple proxies can be centrally deployed in one cloud computing device, or can be distributedly deployed in different cloud computing devices in the cloud computing cluster.
[0102] exist Figure 2A In the scenario of , the interaction module can be a local IDE. Among them, local is also called a local device. The local device includes a terminal computing device under direct control of the user (such as a user terminal such as a desktop computer and a laptop computer). The local IDE refers to an IDE installed on the local device in the form of a client. In some examples, the local IDE may include visual studio, eclipse, etc. The local IDE can install a plug-in and connect to the debug adapter through the plug-in to debug the application 200.
[0103] In other implementations, each subsystem of the application debugging system 100 may also be deployed in the same environment. Figure 2B As shown, the interaction subsystem 102 and the routing subsystem 104 can be deployed in the same cloud computing cluster. The cloud computing cluster can be a public cloud provided by a cloud service provider. The interaction module can be a cloud IDE. The routing subsystem 104 can form a cloud debugger for providing cloud debugging services.
[0104] Cloud service providers can integrate cloud debugger and cloud IDE into one cloud service for users, or provide cloud IDE and cloud debugger as two cloud services for users. In some cases, cloud service providers can provide cloud debugger as a value-added service of cloud IDE. After users purchase or rent the value-added service, the cloud service provider will integrate it into cloud IDE and provide it to users.
[0105] Of course, if Figure 2C As shown, the interaction subsystem 102 and the routing subsystem 104 can also be deployed in different cloud computing clusters. Different cloud computing clusters can be public clouds provided by different cloud service providers. Different cloud service providers provide cloud IDE and cloud debugger for users to use.
[0106] Furthermore, the application 200 debugged by the application debugging system 100 can be deployed in the same or different cloud computing clusters as the interaction subsystem 102 and / or the routing subsystem 104, or can be independently deployed in any data center (such as a user's own data center). Figure 2A , Figure 2B , Figure 2C The exemplary display of the situation where the application 200 is deployed in the data center 300 does not constitute a limitation on the technical solution of the present application.
[0107] in addition, Figure 2A , Figure 2B , Figure 2C The above are just some specific examples of the application debugging system 100 being deployed in different environments or in the same environment. In some implementations, the modules of the application debugging system 100 may also be deployed in other environments, for example, the interaction module and the debug adapter may be deployed in a terminal computing device or a cloud computing device, and the proxy may be deployed in an edge computing cluster (including at least one edge computing device, such as an edge server).
[0108] Next, a method for routing messages in the application debugging system 100 provided in an embodiment of the present application is introduced in detail from the perspective of the routing subsystem 104 .
[0109] S302 : The routing subsystem 104 receives at least one debugging request message sent by at least one interaction subsystem 102 .
[0110] Each debugging request message indicates a request for debugging a sub-application module of application 200. Different debugging request messages may indicate a request for debugging different sub-application modules of application 200. In some embodiments, different debugging request messages may also indicate a request for debugging the same sub-application module of application 200.
[0111] The debugging request message may be generated by the interactive subsystem 102 according to the debugging operation of each user. The debugging operation of the user includes the debugging selection and debugging start operation performed by the user through the GUI provided by the interactive subsystem 102. The debugging operation of the user may also be the debugging selection and debugging start operation sent by the CUI provided by the interactive subsystem 102.
[0112] For ease of understanding, the example of debugging through GUI is used for explanation. The interactive subsystem 102 presents the sub-application modules included in the application 200 to the user through the GUI. The user selects one or more sub-application modules through the GUI, and then starts debugging the selected one or more sub-application modules by triggering the start control on the GUI. The interactive subsystem 102 (specifically the interactive module) generates a debugging request message according to the user's debugging operation.
[0113] The debugging request message includes debugging instructions. When the debugging request message is a debugging request message generated for the first debugging operation on a sub-application module, the debugging instruction includes a command to start debugging, which is used to instruct to start debugging of the sub-application module of application 200. When the debugging request message is a debugging request message generated for a non-first debugging operation on a sub-application module, the debugging instruction includes an instruction to set a breakpoint, an instruction to view stack information, an instruction to display a certain variable, an instruction to track a certain variable, or an instruction to execute in a single step, which is used to instruct to perform breakpoint debugging, view stack information, display variables, variable tracking, or single-step debugging on the sub-application module, etc.
[0114] S304: The routing subsystem 104 routes at least one debugging request message to an agent corresponding to at least one sub-application module requesting debugging.
[0115] The debugging request message is used to request debugging of a sub-application module of the application 200. The debugging request message may carry the identifier of the sub-application module, so that the routing subsystem 104 may route the debugging request message to the agent corresponding to the sub-application module requested for debugging according to the identifier of the sub-application module.
[0116] Among them, the sub-application module is usually deployed in a physical machine or a virtual machine or container on a physical machine. Based on this, the identifier of the sub-application module can be the resource identifier (resource id) of the resource to which the sub-application module belongs, such as the resource identifier of a physical machine, a virtual machine, a container, etc.
[0117] Each node has a host agent. The routing subsystem 104 can also route the debugging request message to the agent corresponding to the sub-application module requested for debugging through the host agent. Specifically, the routing subsystem 104 transmits at least one debugging request message to the host agent of the node where at least one sub-application module requested for debugging is located, and then transmits at least one debugging request message to the agent corresponding to at least one sub-application module requested for debugging through the host agent.
[0118] In some possible implementations, the routing subsystem 104 includes at least one proxy. The host agent of the node where at least one sub-application module of the application 200 is located has a long connection pre-established with the at least one proxy. Taking the host agent of the node where a sub-application module is located as an example, the host agent can send a connection request message to a proxy during initialization, and the proxy establishes a long connection with the host agent. Considering reliability, the host agent can also send connection request messages to multiple proxies, and the multiple proxies respectively establish long connections with the host agent. Among them, one long connection serves as the main connection, and the remaining long connections serve as backup connections. The routing subsystem 104 can transmit the debugging request message to the agent corresponding to the sub-application module requesting debugging through the long connection between the proxy and the host agent.
[0119] It should be noted that when the routing subsystem 104 includes multiple proxies, different host agents can establish long connections with the same proxy or with different proxies. The embodiments of the present application do not limit this. When a user triggers a debugging operation through the GUI or CUI provided by the interactive module (such as IDE), the debug adapter monitors the debugging operation and can establish a long connection with a proxy of the routing subsystem 104. Considering reliability, the debug adapter can also establish long connections with multiple proxies of the routing subsystem 104. For the sake of ease of description, the following text uses the example of the debug adapter establishing a long connection with a proxy.
[0120] The routing subsystem 104 can route at least one debugging request message to the agent of at least one sub-application module requesting debugging through the long connection between the debug adapter and the proxy and the long connection between the proxy and the host agent. The first debugging request message in the at least one debugging request message is used as an example for explanation.
[0121] When the user triggers a debugging operation on a sub-application module of application 200 through the IDE, the debug adapter monitors the debugging operation and establishes a persistent connection with the first proxy. The host agent of the node where the sub-application module is located has a persistent connection established in advance with the second proxy.
[0122] When the routing subsystem 104 includes a proxy, the first proxy and the second proxy are the same proxy, and the proxy can directly transmit the first debugging request message to the host agent through a long connection with the host agent, and then transmit the first debugging request message to the agent corresponding to the sub-application module through the host agent.
[0123] When the routing subsystem 104 includes multiple proxies, the first proxy and the second proxy may be the same proxy or different proxies. The first proxy receives the first debugging request message and can broadcast the first debugging request message to the above-mentioned multiple proxies. In this way, the second proxy can obtain the above-mentioned first debugging request message. The second proxy can transmit the first debugging request message to the host agent through a long connection with the host agent, and then transmit the first debugging request message to the agent corresponding to the sub-application module through the host agent.
[0124] Among them, the first proxy can broadcast the first debugging request message based on the subscription / publish mechanism. Specifically, the routing subsystem 104 maintains a message queue, such as a request queue. Multiple proxies subscribe to the request queue. When the first proxy receives the first debugging request message, it publishes the first debugging request message to the request queue. Multiple proxies monitor that there is a new message in the request queue and obtain the above-mentioned first debugging request message from the request queue. In this way, the first debugging request message is broadcast to multiple proxies.
[0125] In some possible implementations, the sub-application module agent may start debugging the corresponding sub-application module upon receiving the debugging request message, and generate a debugging response message. The routing subsystem 104 receives the debugging response message sent by the agent corresponding to at least one sub-application module requesting debugging, and routes the at least one debugging response message to the corresponding interaction subsystem 102.
[0126] Among them, the debugging response message generated by the agent corresponding to at least one sub-application module can be sent to the host agent first, and the routing subsystem 104 can receive the above debugging response message through the long connection between the host agent, and then transmit the debugging response message to the debug adapter through the long connection between the debug adapter and the debug adapter, and then transmit it to the interaction module (such as IDE), thereby realizing the routing of the debugging response message to the corresponding interaction subsystem 102.
[0127] Based on the above description, an embodiment of the present application provides a message routing method. In this method, the routing subsystem receives at least one debugging request message sent by at least one interactive subsystem, each debugging request message indicates a sub-application module of the application requested for debugging, and then the routing subsystem routes at least one debugging request message to the agent corresponding to at least one sub-application module requested for debugging. In this way, multiple debugging request messages can be routed to the agent corresponding to the sub-application module requested for debugging, realizing many-to-many message routing, supporting multiple users to debug one or more sub-application modules at the same time in the production environment, and improving debugging efficiency.
[0128] exist Figure 3 In the illustrated embodiment, after the proxy of the routing subsystem 104 establishes a long connection with the host agent, the agent corresponding to the sub-application module of the application 200 can also send a discovery message to the host agent, and then the host agent sends the discovery message to the proxy through the long connection with the proxy. The proxy can determine the agent that is reachable to the proxy based on the discovery message. In this way, when the proxy receives the debugging request message, it can determine whether the sub-application module requested for debugging by the debugging request message is reachable. If so, the debugging request message can be transmitted to the corresponding host agent through the long connection with the host agent, and then the debugging request message is transmitted to the agent through the host agent.
[0129] Specifically, the discovery message includes at least the identifier of the sub-application module. The identifier of the sub-application module can be the resource identifier of the resource to which the sub-application module belongs. When the resource is a container, the resource identifier can specifically be a container identifier (containerId). Further, the discovery message can also include at least one of the host name (hostname), Internet Protocol address (IP), agent identifier (agentId), application name (appName), cluster key (clusterKey), service type (servicetype), display name (displayName), instance name (instanceName), process identifier (process id, pid), project identifier (projectId), container group identifier (podId), collector identifier (collectorId), properties (props), ports (ports) and other information.
[0130] The present application embodiment also provides a specific example of a discovery message, as shown below:
[0131] TDiscoveryInfo
[0132] {
[0133] 1: string hostname
[0134] 2: string ip
[0135] 3: string agentId
[0136] 4: string appName
[0137] 5:string clusterKey
[0138] 6: string serviceType
[0139] 7: string displayName
[0140] 8: string instanceName
[0141] 9: string containerId
[0142] 10:i32 pid
[0143] 12: string projectId
[0144] 13:string podId
[0145] 14:string collectorId
[0146] 15:string appId
[0147] 20:map<string,string>props
[0148] 30:list <i32>ports
[0149] 40:list <string>ips
[0150] 50:string tier
[0151] 60:string namespaceName
[0152] 61:i64 created
[0153] 62:i64 updated
[0154] 63:i64 deleted
[0155] 70:optional list <tprofilinginfo>profilingInfo
[0156] }
[0157] Among them, string, i32, and i64 represent data types. For example, string represents a string, and i32 and i64 represent 32-bit integers and 64-bit integers, respectively.
[0158] The proxy receives a discovery message sent by an agent of a sub-application module, which is equivalent to establishing an active session corresponding to the agent. For ease of description, the active session with the agent is referred to as an active agent session (activeAgentSessions) in the embodiment of the present application. The proxy can store the identifier of the agent that establishes an active proxy session with the proxy, such as storing the resourceId of the agent. In some embodiments, the proxy can describe the current active proxy session by maintaining a dynamic hash map. In this way, when routing a debug request message, the routing subsystem 104 can determine whether to transmit the debug request message to the corresponding host agent through the proxy based on the hash map.
[0159] Specifically, a proxy of the routing subsystem 104 receives a debugging request message, and sends the debugging request message to the request queue. Multiple proxies of the routing subsystem 104 monitor that there is a new debugging request message in the request queue, and obtain the debugging request message. Each proxy determines whether the resourceId of the sub-application module requested for debugging by the debugging request message is stored. If so, it indicates that the agent in the corresponding resource has established an active proxy session with the proxy, and the proxy can transmit the debugging request message to the host agent through a long connection with the host agent, and then transmit the debugging request message to the corresponding agent through the host agent; if not, it indicates that the agent in the corresponding resource has established an active proxy session with other proxies, or the corresponding resource has been offline, and the proxy can discard the debugging request message.
[0160] In order to make the technical solution of the present application clearer, the following takes an example in which an interactive subsystem 102 generates a first debugging request message for debugging a first sub-application module and a routing subsystem routes the first debugging request message to explain in detail the method of routing messages in the application debugging system 100 provided in an embodiment of the present application from the perspective of interaction.
[0161] See also Figure 4 The interactive flow chart of the message routing method shown in FIG. 1 includes:
[0162] S402: The host agent establishes a persistent connection with the second proxy during initialization.
[0163] The second proxy is one of the multiple proxies included in the application debugging system 100. During initialization, the hostagent (specifically, the host agent of the node where the first sub-application module is located) can randomly select a proxy (for ease of description, referred to as the second proxy) to establish a long connection.
[0164] S404: the agent sends a discovery message to the host agent, and the host agent sends a discovery message to the second proxy through a persistent connection.
[0165] S406: The second proxy stores the resourceId of the agent that has established an active proxy session with the second proxy.
[0166] The agent sends a discovery message to the second proxy, indicating that the agent is reachable to the second proxy and an active proxy session is established between the second proxy and the agent. The second proxy can store the identifier of the agent that establishes the active proxy session with the second proxy, such as resourceId.
[0167] S408: The debug adapter in the interaction subsystem 102 monitors the debugging operation triggered by the user through the IDE.
[0168] S410: The debug adapter determines whether the debugging operation is the first debugging operation for the first sub-application module, and if so, executes S412, and if not, executes S414.
[0169] S412: The debug adapter establishes a debugging session and a persistent connection with the first proxy.
[0170] A debug session is specifically a session for debugging a sub-application module. A debug session corresponds one-to-one to a sub-application module being debugged. The two ends of a debug session are the debug adapter and the host agent. The debug adapter and the IDE are deployed in the same environment, such as the same terminal computing device, and the host agent and the agent are deployed in the same environment, such as the same node. Therefore, the two ends of a debug session can also be the IDE and the agent. Each debug session has a unique debug session ID. The debug session ID can be used to assist the proxy in routing the debug response message to the corresponding IDE.
[0171] S414: The debug adapter sends a first debugging request message to the first proxy.
[0172] The first debugging request message is used to request debugging of the first sub-application module. The first debugging request message carries resourceId and debug session id.
[0173] It should be noted that S402 to S406 and S408 to S414 may be executed in parallel, or S402 to S406 may be executed first and then S408 to S414, or S408 to S414 may be executed first and then S402 to S406.
[0174] S416: The first proxy sends a debugging request message to the request queue.
[0175] S418: Multiple proxies (including the first proxy and the second proxy) of the routing subsystem 104 obtain the first debugging request message from the request queue.
[0176] The first proxy is a proxy in the routing subsystem 104 that establishes a persistent connection with the debug adapter, and the second proxy is a proxy in the routing subsystem 104 that establishes a persistent connection with the host agent.
[0177] S420: Each proxy (including the first proxy and the second proxy) determines whether the resourceId in the first debugging request message is stored, thereby determining whether the agent of the sub-application module requesting debugging has established an active proxy session with the proxy. If yes, execute S422, if not, execute S424.
[0178] S422: The proxy sends a first debugging request message to the host agent, and then sends the first debugging request message to the agent through the host agent.
[0179] S424: The proxy discards the first debugging request message.
[0180] In this example, the agent of the first sub-application module sends a discovery message to the second proxy in advance, and the second proxy establishes an active proxy session with the agent of the first sub-application module. The second proxy stores the resourceId of the agent. However, the first proxy does not establish an active proxy session with the agent of the first sub-application module, nor does it store the resourceId of the agent.
[0181] Therefore, the first proxy determines that the resourceId in the debugging request message is not stored, and the first proxy executes S424 to discard the first debugging request message. The second proxy determines that the resourceId in the debugging request message is stored, and the second proxy executes S422 to send the first debugging request message to the host agent, and then sends the first debugging request message to the agent through the host agent. In this way, the first debugging request message is safely and reliably transmitted to the agent of the first sub-application module requesting debugging.
[0182] S426: The agent starts debugging the first sub-application module and generates a first debugging response message.
[0183] The agent starts debugging of the first sub-application module according to the debugging instruction in the first debugging request message, generates a debugging response to the debugging instruction, and then generates a first debugging response message.
[0184] S428: the agent sends a debugging response message to the host agent, and then sends a first debugging response message to the response queue through the host agent.
[0185] S430: Multiple proxies (including the first proxy and the second proxy) of the routing subsystem 104 obtain the first debugging response message from the response queue.
[0186] In this way, both the first proxy and the second proxy can obtain the first debugging response message.
[0187] S432: Each proxy (including the first proxy and the second proxy) determines whether the debugsession id in the first debug response message is stored, thereby determining whether a debug session is established between the proxy and the debug adapter. If yes, execute S434, if no, execute S436.
[0188] S434: the proxy sends a first debugging response message through a persistent connection with the debug adapter, and then the debug adapter sends the first debugging response message to the IDE.
[0189] S436: The proxy discards the first debugging response message.
[0190] Each proxy (including the first proxy and the second proxy) compares the debugsession id in the first debug response message with the debug session id recorded in the respective active debug sessions. The first proxy determines that the debug session id in the first debug response message exists in the active debug session, indicating that the first proxy has established an active debug session with the debug adapter. The first proxy can send the first debug response message through a long connection with the debug adapter, and then send the first debug response message to the IDE through the debug adapter. The second proxy determines that the debug session id in the first debug response message does not exist in the active debug session, indicating that the second proxy has not established an active debug session with the debug adapter, and the second proxy discards the first debug response message.
[0191] exist Figure 4 In the illustrated embodiment, the debug messages in the message queue (request queue or response queue) are broadcast to each proxy. In this way, when a proxy goes offline, the host agent or debug adapter can also establish a persistent connection with other proxies, thereby avoiding the situation where the debug messages are sent to the wrong agent or IDE when one or some proxies go offline, thereby improving the availability of the entire system.
[0192] Combination of the above Figures 1 to 4 The message routing method provided in the embodiment of the present application is introduced in detail. The apparatus and device provided in the embodiment of the present application will be introduced in conjunction with the accompanying drawings.
[0193] See also Figure 5 The schematic diagram of the structure of the message routing device shown in FIG. 500 may be a routing subsystem in the aforementioned application debugging system. When the routing subsystem is a software system, the device 500 may also be a hardware device running the routing subsystem. The device 500 includes:
[0194] A communication unit 502 is used to receive at least one debugging request message sent by at least one interactive subsystem, each debugging request message indicating a sub-application module of a requested debugging application;
[0195] The routing unit 504 is used to route the at least one debugging request message to the proxy corresponding to the at least one sub-application module requesting debugging. In some possible implementations, the application is deployed in a production environment, the production environment includes at least one node, and the routing unit 504 is specifically used to:
[0196] Transmitting the at least one debugging request message to a node agent of a node where the at least one sub-application module requested to be debugged is located;
[0197] The at least one debugging request message is transmitted through the node agent to an agent corresponding to at least one sub-application module requesting debugging.
[0198] In some possible implementations, the apparatus includes a plurality of debugging agents, the at least one debugging request message includes a first debugging request message, and the routing unit 504 is specifically configured to:
[0199] broadcasting the first debugging request message to the multiple debugging agents through the first debugging agent;
[0200] The first debugging request message is transmitted to the node agent of the node where the sub-application module requesting debugging is located through the second debugging agent.
[0201] In some possible implementations, a long connection is pre-established between the second debugging agent and a node agent of a node where the sub-application module requesting debugging is located.
[0202] In some possible implementations, the apparatus includes a plurality of debugging agents, the application is deployed in a production environment, the production environment includes at least one node, and the apparatus 500 further includes a connection unit;
[0203] The communication unit 502 is also used for:
[0204] Before receiving the debugging request message sent by the at least one interactive subsystem, receiving, through at least one debugging agent, a connection request message sent by a node agent of a node where at least one sub-application module of the application is located;
[0205] The connection unit is specifically used for:
[0206] A long connection with the node agent is established through the at least one debugging agent.
[0207] In some possible implementations, the communication unit 502 is further configured to:
[0208] receiving at least one debugging response message sent by an agent of at least one sub-application module requesting debugging;
[0209] The routing unit 504 is further configured to:
[0210] The at least one debugging response message is routed to a corresponding interaction subsystem.
[0211] The message routing device 500 according to the embodiment of the present application may correspond to the method described in the embodiment of the present application, and the above and other operations and / or functions of each module / unit of the message routing device 500 are respectively to implement Figure 3 , Figure 4 For the sake of brevity, the corresponding processes of each method in the illustrated embodiment are not described in detail here.
[0212] The present application embodiment also provides an application debugging system 100. Figure 1 The schematic diagram of the structure of the application debugging system 100 shown in the figure includes a routing subsystem 104 and at least one interaction subsystem 102. The application debugging system 100 is used to debug applications running in a production environment.
[0213] The interaction subsystem 102 is used to send a debugging request message to the routing subsystem 104, each debugging request message indicating a request to debug a sub-application module of the application;
[0214] The routing subsystem 104 is used to route at least one debugging request message sent by the at least one interaction subsystem 102 to an agent corresponding to at least one sub-application module requesting debugging.
[0215] In some possible implementations, each interaction subsystem 102 is used to generate a corresponding debugging request message according to the debugging operation of the respective user.
[0216] In some possible implementations, the user's debugging operations include: debugging selection and debugging start operations performed by the user through the graphical user interface GUI provided by the interactive subsystem, or debugging selection and debugging start operations sent by the user through the command user interface CUI provided by the interactive subsystem.
[0217] In some possible implementations, the production environment includes at least one node, and the routing subsystem 104 is specifically used for:
[0218] Transmitting the at least one debugging request message to a node agent of a node where the at least one sub-application module requested to be debugged is located;
[0219] The at least one debugging request message is transmitted through the node agent to an agent corresponding to at least one sub-application module requesting debugging.
[0220] In some possible implementations, the routing subsystem 104 includes a plurality of debugging agents, the at least one debugging request message includes a first debugging request message, and the routing subsystem 104 is specifically configured to:
[0221] broadcasting the first debugging request message to the multiple debugging agents through the first debugging agent;
[0222] The first debugging request message is transmitted to the node agent of the node where the sub-application module requesting debugging is located through the second debugging agent.
[0223] In some possible implementations, a long connection is pre-established between the second debugging agent and a node agent of a node where the sub-application module requesting debugging is located.
[0224] In some possible implementations, the routing subsystem 104 includes multiple debugging agents, the production environment includes at least one node, and the routing subsystem 104 is further used to:
[0225] Before receiving the debugging request message sent by the at least one interactive subsystem, receiving, through at least one debugging agent, a connection request message sent by a node agent of a node where at least one sub-application module of the application is located;
[0226] A long connection with the node agent is established through the at least one debugging agent.
[0227] In some possible implementations, the routing subsystem 104 is further configured to:
[0228] receiving at least one debugging response message sent by an agent of at least one sub-application module requesting debugging;
[0229] The at least one debugging response message is routed to a corresponding interaction subsystem.
[0230] The application debugging system 100 according to the embodiment of the present application may correspond to executing the method described in the embodiment of the present application, and the above and other operations and / or functions of each subsystem of the application debugging system 100 are respectively to implement Figure 3 , Figure 4 For the sake of brevity, the corresponding processes of each method in the illustrated embodiment are not described in detail here.
[0231] The present application also provides a computing device 600. The computing device 600 may be a terminal device such as a laptop computer or a desktop computer, or a computer cluster in a cloud environment or an edge environment. The computing device 600 is specifically used to implement the following Figure 5 The functionality of the apparatus 500 for message routing is shown.
[0232] Figure 6 A schematic diagram of the structure of a computing device 600 is provided. Figure 6 As shown, computing device 600 includes bus 601, processor 602, communication interface 603 and memory 604. Processor 602, memory 604 and communication interface 603 communicate with each other via bus 601.
[0233] The bus 601 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0234] The processor 602 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0235] The communication interface 603 is used to communicate with the outside, for example, to receive at least one debugging request message sent by the at least one interactive subsystem, to receive at least one debugging response message sent by the agent of at least one sub-application module requesting debugging, and so on.
[0236] The memory 604 may include a volatile memory, such as a random access memory (RAM). The memory 604 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0237] The memory 604 stores executable code, and the processor 602 executes the executable code to perform the aforementioned message routing method. Figure 5 In the case of the embodiment shown, and Figure 5 When each unit of the message routing device 500 described in the embodiment is implemented by software, the execution Figure 5 The software or program code required for the functions of the routing module 504 and the connection module is stored in the memory 604. The functions of the communication module 502 are implemented through the communication interface 603.
[0238] Specifically, the communication interface 603 receives at least one debugging request message sent by at least one interactive subsystem, and transmits the at least one debugging request message to the processor 602 through the bus 601. The processor 602 executes the program code in the memory 604, thereby routing the at least one debugging request message to the agent corresponding to at least one sub-application module requesting debugging.
[0239] Further, the agent of at least one sub-application module requesting debugging can start debugging of the corresponding sub-application module according to the debugging request message, and generate at least one debugging response message. The communication interface 603 receives at least one debugging response message sent by the agent through the host agent, and transmits the at least one debugging response message to the processor 602 through the bus 601. The processor 602 executes the program code in the memory 604, thereby routing at least one debugging response message to the corresponding IDE.
[0240] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the message routing method of the apparatus 500 for message routing.
[0241] The embodiment of the present application also provides a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the process or function described in the embodiment of the present application is generated in whole or in part.
[0242] The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer or data center to another website, computer or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.
[0243] The computer program product may be a software installation package, which may be downloaded and executed on a computing device when any of the aforementioned message routing methods is required.
[0244] The descriptions of the processes or structures corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.< / tprofilinginfo> < / string>
Claims
1. A message routing method, characterized in that: The method is applied to an application debugging system, the application debugging system includes a routing subsystem and multiple interaction subsystems, the application debugging system is used to enable multiple users to debug applications running in a production environment, the multiple interaction subsystems include a first interaction subsystem and a second interaction subsystem, the routing subsystem includes multiple debugging agents, the multiple debugging agents include a first debugging agent and a second debugging agent, the sub-application module connected to the first debugging agent is different from the sub-application module connected to the second debugging agent, the method includes: The first debugging agent in the routing subsystem receives a first debugging request message sent by the first interaction subsystem, the first debugging request message indicates a request to debug a first sub-application module of the application, the first sub-application module connects to the second debugging agent, and the first debugging agent broadcasts the first debugging request message to the multiple debugging agents; Alternatively, the second debugging agent in the routing subsystem receives the first debugging request message sent by the second interaction subsystem; The second debugging agent in the routing subsystem routes the first debugging request message to an agent corresponding to the first sub-application module requesting debugging.
2. The method according to claim 1, characterized in that Each interactive subsystem generates a corresponding debugging request message according to the debugging operation of the respective user.
3. The method according to claim 2, characterized in that The user's debugging operations include: debugging selection and debugging start operations performed by the user through the graphical user interface GUI provided by the interactive subsystem, or debugging selection and debugging start operations sent by the user through the command user interface CUI provided by the interactive subsystem.
4. The method according to any one of claims 1 to 3, characterized in that: The production environment includes at least one node, and the second debugging agent in the routing subsystem routes the first debugging request message to an agent corresponding to the first sub-application module requesting debugging, including: The second debugging agent in the routing subsystem transmits the first debugging request message to the node agent of the node where the first sub-application module requested for debugging is located; The routing subsystem transmits the first debugging request message to the agent corresponding to the first sub-application module requesting debugging through the node agent.
5. The method according to claim 4, characterized in that A long connection is pre-established between the second debugging agent and the node agent of the node where the first sub-application module requested for debugging is located.
6. The method according to any one of claims 1 to 5, characterized in that: The production environment includes at least one node. Before the routing subsystem receives the debugging request messages sent by the multiple interaction subsystems, the method further includes: The multiple debugging agents in the routing subsystem receive a connection request message sent by a node agent of a node where at least one sub-application module of the application is located; The multiple debugging agents of the routing subsystem establish a long connection with the node agent.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: The routing subsystem receives at least one debugging response message sent by an agent of at least one sub-application module requesting debugging; The routing subsystem routes the at least one debugging response message to the corresponding interaction subsystem.
8. A message routing device, characterized in that: The device is applied to an application debugging system, the application debugging system includes a routing subsystem and multiple interaction subsystems, the application debugging system is used to enable multiple users to debug applications running in a production environment, the multiple interaction subsystems include a first interaction subsystem and a second interaction subsystem, the routing subsystem includes multiple debugging agents, the multiple debugging agents include a first debugging agent and a second debugging agent, the sub-application module connected to the first debugging agent is different from the sub-application module connected to the second debugging agent, and the device includes: a communication unit, configured to enable a first debugging agent in the routing subsystem to receive a first debugging request message sent by the first interaction subsystem, wherein the first debugging request message indicates a request to debug a first sub-application module of an application, wherein the first sub-application module is connected to a second debugging agent, Alternatively, the second debugging agent in the routing subsystem receives the first debugging request message sent by the second interaction subsystem; The communication unit is further configured to broadcast the first debugging request message to the multiple debugging agents; A routing unit is used to route the first debugging request message to an agent corresponding to the first sub-application module requesting debugging.
9. The device according to claim 8, characterized in that The application is deployed in a production environment, the production environment includes at least one node, and the routing unit is specifically used for: Transmitting the first debugging request message to a node agent of a node where the first sub-application module requested for debugging is located; The first debugging request message is transmitted to the agent corresponding to the first sub-application module requesting debugging through the node agent.
10. The device according to claim 9, characterized in that A long connection is pre-established between the second debugging agent and the node agent of the node where the sub-application module requesting debugging is located.
11. The device according to any one of claims 8 to 10, characterized in that The application is deployed in a production environment, the production environment includes at least one node, and the device further includes a connection unit; The communication unit is also used for: Before receiving the debugging request messages sent by the multiple interactive subsystems, receiving, through the multiple debugging agents, a connection request message sent by a node agent of a node where at least one sub-application module of the application is located; The connection unit is specifically used for: A long connection with the node agent is established through the multiple debugging agents.
12. The device according to any one of claims 8 to 11, characterized in that The communication unit is also used for: receiving at least one debugging response message sent by an agent of at least one sub-application module requesting debugging; The routing unit is also used for: The at least one debugging response message is routed to a corresponding interaction subsystem.
13. An application debugging system, characterized in that: The application debugging system includes a routing subsystem and at least one interaction subsystem, the application debugging system is used to enable multiple users to debug applications running in a production environment, the multiple interaction subsystems include a first interaction subsystem and a second interaction subsystem, the routing subsystem includes multiple debugging agents, the multiple debugging agents include a first debugging agent and a second debugging agent, and the sub-application module connected to the first debugging agent is different from the sub-application module connected to the second debugging agent; The first interaction subsystem is used to send a first debugging request message to a first debugging agent in the routing subsystem, wherein the first debugging request message indicates a request to debug a first sub-application module of the application, and the first sub-application module is connected to the second debugging agent; The second interaction subsystem is used to send a first debugging request message to a second debugging agent in the routing subsystem; The first debugging agent in the routing subsystem is used to broadcast the first debugging request message to the multiple debugging agents; The second debugging agent in the routing subsystem is used to route the first debugging request message to the agent corresponding to the first sub-application module requesting debugging.
14. The system according to claim 13, characterized in that Each interactive subsystem is used to generate a corresponding debugging request message according to the debugging operation of a respective user.
15. The system according to claim 14, characterized in that The user's debugging operations include: debugging selection and debugging start operations performed by the user through the graphical user interface GUI provided by the interactive subsystem, or debugging selection and debugging start operations sent by the user through the command user interface CUI provided by the interactive subsystem.
16. The system according to any one of claims 13 to 15, characterized in that The production environment includes at least one node, and the second debugging agent in the routing subsystem is specifically used for: Transmitting the first debugging request message to a node agent of a node where the first sub-application module requested for debugging is located; The first debugging request message is transmitted to the agent corresponding to the first sub-application module requesting debugging through the node agent.
17. The system according to claim 16, characterized in that A long connection is pre-established between the second debugging agent and the node agent of the node where the first sub-application module requested for debugging is located.
18. The system according to any one of claims 13 to 17, characterized in that The production environment includes at least one node, and the routing subsystem is further used for: Before receiving the debugging request messages sent by the multiple interactive subsystems, receiving, through the multiple debugging agents, a connection request message sent by a node agent of a node where at least one sub-application module of the application is located; A long connection with the node agent is established through the multiple debugging agents.
19. The system according to any one of claims 13 to 18, characterized in that The routing subsystem is also used to: receiving at least one debugging response message sent by an agent of at least one sub-application module requesting debugging; The at least one debugging response message is routed to a corresponding interaction subsystem.
20. A computing device, characterized in that The computing device includes a processor and a memory; The processor is configured to execute instructions stored in the memory so that the computing device performs the method according to any one of claims 1 to 7.
21. A computer-readable storage medium, characterized in that: The method comprises computer program instructions, which, when executed by a computing device, perform the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Debugging applications at resource constrained virtual machines using dynamically installable lightweight agents
US20070113218A1