A message topic processing method, device and computer readable medium
By obtaining the application's runtime environment and topic information, the target message topic identifier is automatically assembled, solving the problem of low naming efficiency in Kafka topics, improving naming efficiency, and avoiding production incidents.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING SHANGYIN MICRO CORE TECH CO LTD
- Filing Date
- 2022-12-29
- Publication Date
- 2026-07-31
AI Technical Summary
In the software development process, naming Kafka topics is inefficient and manual naming can easily lead to forgetting topic names, resulting in production incidents.
By obtaining the application's runtime environment information and topic information, the identifier of the target message topic is automatically assembled, solving the problem of low topic naming efficiency and avoiding the risk of not being able to remember the topic name.
It improved topic naming efficiency, prevented production accidents, and ensured the normal operation of the application in different environments.
Smart Images

Figure CN116011437B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of big data development and application technology, and in particular relates to a method, apparatus and computer-readable medium for processing message topics. Background Technology
[0002] In daily software development, Kafka, as middleware, can be used to create multiple topics for different environments to complete the entire software development process. However, in practice, manually naming topics for different environments and modifying the corresponding code is required. This increases the workload of topic naming, leading to low naming efficiency. Moreover, the large volume of topics can cause forgetting to remember them, potentially resulting in production incidents. Summary of the Invention
[0003] In view of this, this application provides a method, apparatus and computer-readable medium for processing message topics to solve the problems of low topic naming efficiency and the occurrence of production accidents due to the large number of topics that need to be named manually, which can lead to the inability to remember topic names.
[0004] To address the above problems, this application provides the following solution:
[0005] A method for processing message topics includes:
[0006] Get the runtime environment information corresponding to the current runtime environment of the application;
[0007] Determine the topic information of each message topic currently corresponding to the application;
[0008] Based on the runtime environment information and the topic information of each message topic, the target topic information of the target message topic corresponding to the application and matching the current runtime environment is determined, so that the application can perform corresponding operations based on the target topic information in the current runtime environment.
[0009] Optionally, obtaining the runtime environment information corresponding to the current runtime environment of the application includes:
[0010] Obtain the runtime environment identifier corresponding to the current runtime environment of the application, wherein the runtime environment includes one of the following: development environment, testing environment, pre-production environment, and production environment.
[0011] Optionally, determining the topic information of each message topic currently corresponding to the application includes:
[0012] Obtain the theme configuration information currently corresponding to the application; the theme configuration information includes at least some of the following information: the first theme identifier of the first message theme that the application needs to use, and the second theme identifier of the second message theme that needs to be deleted;
[0013] The topic information of each message topic currently corresponding to the application includes: the topic identifier of each message topic configured in the topic configuration information.
[0014] Optionally, determining the target topic information of the target message topic corresponding to the application and matching the current operating environment based on the operating environment information and the topic information of each message topic includes:
[0015] The runtime environment identifier corresponding to the current runtime environment of the application is assembled with the topic information of each message topic corresponding to the current runtime environment of the application to obtain the target topic information of each target message topic.
[0016] Optionally, determining the target topic information of the target message topic corresponding to the application and matching the current operating environment based on the operating environment information and the topic information of each message topic includes:
[0017] The application's current runtime environment identifier is assembled with the first topic identifier of the first message topic corresponding to the application to obtain the first target topic identifier of the first target message topic that the application needs to use in the current runtime environment;
[0018] The current runtime environment identifier of the application is assembled with the second topic identifier of the second message topic corresponding to the application to obtain the first target topic identifier of the second target message topic that the application needs to delete in the current runtime environment;
[0019] The target topic information includes a first target topic identifier and a second target topic identifier.
[0020] Optionally, the application performs corresponding operations based on the target topic information in the current operating environment, including:
[0021] During the application startup phase, it is determined whether at least a portion of the first target message topics required for use are missing in the preset middleware system. If they are missing, at least a portion of the first target message topics required for use are created.
[0022] Determine whether a second target message topic that needs to be deleted exists in the preset middleware system. If it exists, delete the second target message topic that needs to be deleted.
[0023] Optionally, the application performing corresponding operations based on the target topic information in the current operating environment further includes:
[0024] During the application runtime phase, messages are produced to and / or consumed from the middleware system based on the message topics that correspond to the current runtime environment in the middleware system.
[0025] Optionally, the step of producing messages to the middleware system and / or consuming messages from the middleware system based on the message topics corresponding to the current runtime environment in the middleware system for the application includes:
[0026] Obtain the production message topic corresponding to the first message produced by the application, assemble the current running environment identifier with the production message topic to obtain the target production message topic corresponding to the first message in the current running environment, and deliver the first message to the target production message topic of the middleware system;
[0027] And / or, obtain the consumption message topic corresponding to the second message to be consumed by the application, assemble the runtime environment identifier of the current runtime environment with the consumption message topic to obtain the target consumption message topic corresponding to the second message in the current runtime environment, and send the second message from the target consumption message topic of the middleware system.
[0028] A message topic processing apparatus, comprising:
[0029] The acquisition unit is used to acquire runtime environment information corresponding to the current runtime environment of the application.
[0030] The first determining unit is used to determine the topic information of each message topic currently corresponding to the application.
[0031] The second determining unit is used to determine the target topic information of the target message topic corresponding to the application in the current operating environment based on the operating environment information and the topic information of each message topic, so that the application can perform corresponding operations in the current operating environment based on the target topic information.
[0032] A computer-readable medium having a computer program stored thereon, which, when executed by a processor, can be used to implement the message topic processing method as described in any of the preceding claims.
[0033] As can be seen from the above solutions, the message topic processing method, apparatus, and computer-readable medium disclosed in this application obtain the runtime environment information corresponding to the current runtime environment of the application, determine the topic information of each message topic corresponding to the application, and determine the target topic information of the target message topic corresponding to the application and matching the current runtime environment based on the runtime environment information and the topic information of each message topic, so that the application can perform corresponding operations based on the target topic information in the current runtime environment. This application determines the target topic information of the target message topic corresponding to the application and matching the current runtime environment by using runtime environment information and the topic information of each message topic, thus solving the problem of low topic naming efficiency and avoiding production accidents caused by forgetting topic names due to the large number of names to be named manually. Attached Figure Description
[0034] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0035] Figure 1 This is a flowchart illustrating a method for processing message topics provided in this application;
[0036] Figure 2 This is an architecture diagram of the application runtime environment for the message topic processing method provided in this application;
[0037] Figure 3 This is a flowchart illustrating the application startup phase of the message topic processing method provided in this application;
[0038] Figure 4 This is a flowchart illustrating the application runtime phase of the message topic processing method provided in this application;
[0039] Figure 5 This is a structural diagram of the message topic processing device provided in this application. Detailed Implementation
[0040] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0041] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0042] It should be noted that the concepts of "first" and "second" mentioned in this application are only used to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0043] It should be noted that the terms "a" and "a plurality of" used in this application are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0044] Nowadays, in the process of software development using Kafka as middleware, a Kafka cluster environment is first set up for use throughout the software development process. During the software development process, multiple topics corresponding to different environments need to be created in Kafka, which helps to distinguish different environments and thus ensure environment isolation.
[0045] For example, consider four environments: development (dev), testing (test), pre-production (unprod), and production (prod). Kafka, as a message queue software, can create many topics that satisfy these four environments after it starts running, allowing different messages to be sent to different topics. For instance, backend logs are sent to the `back_log_topic`, and frontend logs are sent to the `front_log_topic`. Corresponding to these two types of messages, Kafka can create topic names corresponding to the four environments: `back_log_topic_dev`, `front_log_topic_dev`, `back_log_topic_test`, `front_log_topic_test`, `back_log_topic_unprod`, `front_log_topic_unprod`, `back_log_topic_prod`, and `front_log_topic_prod`. These topic names are distinguished by adding an environment identifier to the end of the message's corresponding topic name.
[0046] In known technologies, the above naming process is done manually. Depending on the environment and the corresponding operations for the message topic, the code may need to be modified again, or the same code may need to be copied and pasted multiple times. The workload of naming topics is very large, resulting in low efficiency. Furthermore, since the entire naming process is done manually, there is a high probability that the topic names will not be remembered due to the large number of topics to be named, which could lead to production accidents.
[0047] To address the aforementioned issues, this application proposes a method, apparatus, and computer-readable medium for processing message topics. By using runtime environment information and topic information of each message topic, the target topic information of the target message topic corresponding to the application and matching the current runtime environment is determined. This solves the problem of low topic naming efficiency and avoids production accidents caused by forgetting topic names due to the large number of names to be named manually.
[0048] See Figure 1 As shown, the implementation flow of the message topic processing method provided in this application includes:
[0049] Step 101: Obtain the runtime environment information corresponding to the current runtime environment of the application.
[0050] See also Figure 2 The diagram illustrates the architecture of the application runtime environment for the message topic processing method. The runtime environment can include one of the following: development environment, testing environment, pre-production environment, or production environment. The development environment is primarily used during the software development phase, while the testing environment is primarily used during the software testing phase, which may involve multiple rounds of testing, resulting in multiple testing environments. Figure 2 The test environment includes Test 1, Test 2, Test N, etc. The pre-production environment is a full regression environment before the production environment, and it is a running environment that is close to the production environment. The production environment is the environment in which actual business operations are carried out.
[0051] Specifically, what is obtained here is the runtime environment identifier corresponding to the current running environment of the application. The runtime environment identifier is used to represent the environment in which the application is running. For example, the environment identifier of the development environment can be dev, the environment identifier of the test environment can be test, the environment identifier of the pre-production environment can be unprod, and the environment identifier of the production environment can be prod. In this way, the corresponding Topic names in different runtime environments can be easily distinguished.
[0052] Step 102: Determine the topic information of each message topic currently corresponding to the application.
[0053] Next, the application obtains the current theme configuration information from the configuration center or configuration file. The theme configuration information includes the theme identifiers of each configured message theme, such as the first theme identifier of the first message theme that the application needs to use or the second theme identifier of the second message theme that needs to be deleted.
[0054] For example, the first message topic that the application needs to use is the name of the topic that the application needs to use. If there are multiple topics, they are separated by commas: `kafka.topics.using = topic_a, topic_b, topic_c`. The second message topic that the application needs to delete is the name of a topic that the application has used in the past but no longer needs: `kafka.topics.delete = topic_d, topic_f`. Multiple topics are also separated by commas. These second message topics that need to be deleted are generally topics that were created incorrectly in Kafka, or topics that are only temporarily used and will not be used later. Deleting these second message topics helps to clean up unused topics in Kafka, making resource management easier and facilitating the use of remaining topics.
[0055] Step 103: Based on the runtime environment information and the topic information of each message topic, determine the target topic information of the target message topic that matches the current runtime environment for the application, so that the application can perform corresponding operations based on the target topic information in the current runtime environment.
[0056] Next, the runtime environment identifier corresponding to the application's current runtime environment is assembled with the topic information of each corresponding message topic to obtain the target topic information of the target message topic. This target topic information may include a first target topic identifier and a second target topic identifier. The application's current runtime environment identifier is assembled with the first topic identifier of the first message topic currently corresponding to the application to obtain the first target topic identifier of the first target message topic that the application needs to use in the current runtime environment. The application's current runtime environment identifier is assembled with the second topic identifier of the second message topic currently corresponding to the application to obtain the second target topic identifier of the second target message topic that needs to be used in the current runtime environment.
[0057] Taking a Spring Boot application as an example, the configuration information is as follows:
[0058] The application will use topic names kafka.topics.using = topic_a, topic_b, topic_c. Topics that have been used in the past but are no longer needed and need to be deleted include kafka.topics.delete = topic_d. The environment identifier is spring.profile.active = dev. When configuring the code, developers only need to remember topic_a, topic_b, topic_c, topic_d. During the actual execution of the application, the reassembled topic_a_dev, topic_b_dev, topic_c_dev, and topic_d_dev will be used, based on the runtime environment and the corresponding target topic.
[0059] It should be noted that the application performs corresponding operations based on the target topic information in the current runtime environment in two phases: the application startup phase and the application runtime phase.
[0060] During the application startup phase, see Figure 3 The flowchart of the application startup phase of the message topic processing method provided in this application is shown in the figure:
[0061] Upon application startup, the system first retrieves the application's runtime environment information. It loads the topics the application will use and the topics to be deleted from the configuration file. Then, it obtains the topic names corresponding to the runtime environment. Here, the runtime environment identifier is assembled with the topic information used by the application or the topic information to be deleted to obtain the first target message topic to be used and the second target message topic to be deleted, as mentioned above. Next, it checks if the required first target message topic is missing in the preset middleware system (Kafka). If it is missing, it creates the required topic for the corresponding environment in Kafka and establishes a connection to that Kafka topic in memory. After successful connection establishment, it checks if the corresponding topic for the application's environment to be deleted exists in the preset middleware system (Kafka). If it does, it deletes the corresponding topic in Kafka and removes the connection to that Kafka topic in memory. Once the Kafka topic connection is successfully deleted, the application starts successfully. If the Kafka topic connection creation fails during topic creation or deletion, the application startup fails.
[0062] During the application runtime phase, see Figure 4 This application provides a flowchart illustrating the application runtime phase of the message topic processing method.
[0063] The application demonstrates two operations: producing messages and consuming messages. These operations can occur in various environments mentioned above, such as pre-production, production, and testing environments, and each environment has its corresponding Topic name, such as... Figure 2 As shown, Development Environment 1 corresponds to Development Environment 1 topics, Development Environment 2 corresponds to Development Environment 2 topics, Test Environment 1 corresponds to Test Environment 1 topics, Pre-production Environment corresponds to Pre-production Environment topics, and Production Environment corresponds to Production Environment topics. Based on the message topics in the middleware system that match the current running environment, the application produces messages to the middleware system and / or consumes messages from the middleware system.
[0064] When producing a message, the topic name A corresponding to the application's runtime environment is obtained, which is the production message topic corresponding to the first message produced by the application. The runtime environment identifier of the current runtime environment is assembled with the production message topic to obtain the target production message topic corresponding to the first message in the current runtime environment. Then, the message is sent to the target topic A, which means that the first message is delivered to the target production message topic of the middleware system, and the message delivery is completed.
[0065] When consuming a message, the application obtains the topic name A corresponding to its runtime environment, which is the consumption message topic corresponding to the second message to be consumed by the application. The runtime environment identifier of the current runtime environment is assembled with the consumption message topic to obtain the target consumption message topic of the second message in the current runtime environment. Then, the message is read from the target topic A, which is the second message is read from the target consumption message topic of the middleware system, and the message consumption is completed.
[0066] In summary, the message topic processing method disclosed in this application obtains the runtime environment information corresponding to the current runtime environment of the application, determines the topic information of each message topic corresponding to the application, and determines the target topic information of the target message topic matching the current runtime environment based on the runtime environment information and the topic information of each message topic, so that the application can perform corresponding operations based on the target topic information in the current runtime environment. This application determines the target topic information of the target message topic matching the current runtime environment of the application by using runtime environment information and the topic information of each message topic, solving the problem of low topic naming efficiency and avoiding production accidents caused by forgetting topic names due to the large number of names to be named manually.
[0067] In addition to the above-mentioned method for processing message topics, this application also provides a message topic processing apparatus, the composition of which is as follows: Figure 5 As shown, it includes:
[0068] The acquisition unit 10 is used to acquire runtime environment information corresponding to the current runtime environment of the application.
[0069] The first determining unit 20 is used to determine the topic information of each message topic currently corresponding to the application;
[0070] The second determining unit 30 is used to determine the target topic information of the target message topic corresponding to the application in the current operating environment based on the operating environment information and the topic information of each message topic, so that the application can perform corresponding operations in the current operating environment based on the target topic information.
[0071] In one embodiment, the acquisition unit 10 is specifically used for:
[0072] Obtain the runtime environment identifier corresponding to the current runtime environment of the application, wherein the runtime environment includes one of the following: development environment, testing environment, pre-production environment, and production environment.
[0073] In one embodiment, the first determining unit 20 is specifically used for:
[0074] Obtain the theme configuration information currently corresponding to the application; the theme configuration information includes at least some of the following information: the first theme identifier of the first message theme that the application needs to use, and the second theme identifier of the second message theme that needs to be deleted;
[0075] The topic information of each message topic currently corresponding to the application includes: the topic identifier of each message topic configured in the topic configuration information.
[0076] In one embodiment, the second determining unit 30 is specifically used for:
[0077] The runtime environment identifier corresponding to the current runtime environment of the application is assembled with the topic information of each message topic corresponding to the current runtime environment of the application to obtain the target topic information of each target message topic.
[0078] In one embodiment, the second determining unit 30 is specifically used for:
[0079] The application's current runtime environment identifier is assembled with the first topic identifier of the first message topic corresponding to the application to obtain the first target topic identifier of the first target message topic that the application needs to use in the current runtime environment;
[0080] The current runtime environment identifier of the application is assembled with the second topic identifier of the second message topic corresponding to the application to obtain the first target topic identifier of the second target message topic that the application needs to delete in the current runtime environment;
[0081] The target topic information includes a first target topic identifier and a second target topic identifier.
[0082] In one embodiment, the second determining unit 30 is specifically used for:
[0083] During the application startup phase, it is determined whether at least a portion of the first target message topics required for use are missing in the preset middleware system. If they are missing, at least a portion of the first target message topics required for use are created.
[0084] Determine whether a second target message topic that needs to be deleted exists in the preset middleware system. If it exists, delete the second target message topic that needs to be deleted.
[0085] In one embodiment, the above-mentioned apparatus further includes:
[0086] The execution unit is used during the application runtime phase to produce messages to the middleware system and / or consume messages from the middleware system based on the various message topics in the middleware system that correspond to the current runtime environment of the application.
[0087] In one embodiment, the operating unit is specifically used for:
[0088] Obtain the production message topic corresponding to the first message produced by the application, assemble the current runtime environment identifier with the production message topic to obtain the target production message topic corresponding to the first message in the current runtime environment, and deliver the first message to the target production message topic of the middleware system;
[0089] And / or, obtain the consumption message topic corresponding to the second message to be consumed by the application, assemble the runtime environment identifier of the current runtime environment with the consumption message topic to obtain the target consumption message topic corresponding to the second message in the current runtime environment, and retrieve the second message from the target consumption message topic of the middleware system.
[0090] In addition, embodiments of this application also provide a computer-readable medium having a computer program stored thereon, which, when executed by a processor, can be used to implement various processing steps of a message topic processing method.
[0091] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0092] For ease of description, the above systems or devices are described separately as various modules or units based on their functions. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware components.
[0093] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.
[0094] Finally, it should be noted that in this document, relational terms such as first, second, third, and fourth are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0095] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method of processing a message subject, characterized by, include: Get the runtime environment information corresponding to the current runtime environment of the application; Determine the topic information of each message topic currently corresponding to the application; Based on the runtime environment information and the topic information of each message topic, the target topic information of the target message topic corresponding to the application and matching the current runtime environment is determined, so that the application can perform corresponding operations based on the target topic information in the current runtime environment; The step of determining the topic information of each message topic currently corresponding to the application includes: Obtain the theme configuration information currently corresponding to the application; the theme configuration information includes at least some of the following information: the first theme identifier of the first message theme that the application needs to use, and the second theme identifier of the second message theme that needs to be deleted; The topic information of each message topic currently corresponding to the application includes: the topic identifier of each message topic configured in the topic configuration information; The application performs corresponding operations based on the target topic information in the current operating environment, including: During the application startup phase, it is determined whether at least a portion of the first target message topics required for use are missing in the preset middleware system. If they are missing, at least a portion of the first target message topics required for use are created. Determine whether a second target message topic that needs to be deleted exists in the preset middleware system. If it exists, delete the second target message topic that needs to be deleted. The step of determining the target topic information of the target message topic corresponding to the application and matching the current operating environment based on the operating environment information and the topic information of each message topic includes: The runtime environment identifier corresponding to the current runtime environment of the application is assembled with the topic information of each message topic corresponding to the current runtime environment of the application to obtain the target topic information of each target message topic.
2. The method of claim 1, wherein, The step of obtaining the runtime environment information corresponding to the current runtime environment of the application includes: Obtain the runtime environment identifier corresponding to the current runtime environment of the application, wherein the runtime environment includes one of the following: development environment, testing environment, pre-production environment, and production environment.
3. The method of claim 1, wherein, The step of determining the target topic information of the target message topic corresponding to the application and matching the current operating environment based on the operating environment information and the topic information of each message topic includes: The application's current runtime environment identifier is assembled with the first topic identifier of the first message topic corresponding to the application to obtain the first target topic identifier of the first target message topic that the application needs to use in the current runtime environment; The application's current runtime environment identifier is assembled with the second topic identifier of the second message topic corresponding to the application to obtain the second target topic identifier of the second target message topic that the application needs to delete in the current runtime environment; The target topic information includes a first target topic identifier and a second target topic identifier.
4. The method of claim 3, wherein, The application performs corresponding operations based on the target topic information in the current operating environment, and further includes: During the application runtime phase, messages are produced to and / or consumed from the middleware system based on the message topics that correspond to the current runtime environment in the middleware system.
5. The method according to claim 4, characterized in that, The step of producing messages to and / or consuming messages from the middleware system based on the message topics corresponding to the current operating environment in the middleware system for the application includes: Obtain the production message topic corresponding to the first message produced by the application, assemble the current running environment identifier with the production message topic to obtain the target production message topic corresponding to the first message in the current running environment, and deliver the first message to the target production message topic of the middleware system; And / or, obtain the consumption message topic corresponding to the second message to be consumed by the application, assemble the runtime environment identifier of the current runtime environment with the consumption message topic to obtain the target consumption message topic corresponding to the second message in the current runtime environment, and read the second message from the target consumption message topic of the middleware system.
6. A message topic processing apparatus, characterized in that, include: The acquisition unit is used to acquire runtime environment information corresponding to the current runtime environment of the application. The first determining unit is used to determine the topic information of each message topic currently corresponding to the application. The second determining unit is configured to determine the target topic information of the target message topic corresponding to the application and matching the current operating environment based on the operating environment information and the topic information of each message topic, so that the application can perform corresponding operations based on the target topic information in the current operating environment; The first determining unit is configured to obtain the topic configuration information currently corresponding to the application; the topic configuration information includes at least some of the following information: the first topic identifier of the first message topic that the application needs to use, and the second topic identifier of the second message topic that needs to be deleted; The topic information of each message topic currently corresponding to the application includes: the topic identifier of each message topic configured in the topic configuration information; The second determining unit is used to determine, during the application startup phase, whether at least a portion of the first target message topics required for use are missing in the preset middleware system; if missing, to create at least a portion of the first target message topics required for use. Determine whether a second target message topic that needs to be deleted exists in the preset middleware system. If it exists, delete the second target message topic that needs to be deleted. The step of determining the target topic information of the target message topic corresponding to the application and matching the current operating environment based on the operating environment information and the topic information of each message topic includes: The runtime environment identifier corresponding to the current runtime environment of the application is assembled with the topic information of each message topic corresponding to the current runtime environment of the application to obtain the target topic information of each target message topic.
7. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it can be used to implement the message topic processing method as described in any one of claims 1-5.