Service message consumption method and device, equipment and storage medium
By creating themes and monitoring messages in business services, combined with custom annotations to determine the type of message consumption, the problem of high system coupling and limited scalability in traditional message processing methods, and realized efficient and stable message transmission and business system performance performance promote.
Patent Information
- Application Number
- CN202411410781.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-01-28
AI Technical Summary
Traditional message processing methods lack effective management and coordination mechanisms, resulting in high system coupling and limited scalability and flexibility. Especially in a large number of concurrent message scenarios, it may lead to delayed processing of key messages, affecting the system's real-time and responsiveness.
Create the theme in business services through the customer package, and conduct information monitoring based on the theme, obtain a custom annotation to determine the target consumption message, and send the target consumption message through the tool class to realize the one -to -one binding of business services and themes.
A more efficient and stable message transmission has been achieved, the operating efficiency and performance of the business system are improved, and helping different business modules work better.
Smart Images

Figure CN119376975A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a service message consumption method, device, equipment and storage medium. Background Art
[0002] In today's digital age, the rapid transmission and efficient processing of information are essential for various business service systems. As a common communication middleware technology, the publish-subscribe system of message queues plays a key role in distributed systems. However, with the growth of business, how to effectively manage and optimize the performance of message queues and ensure the reliability and consistency of messages has gradually become a challenge that needs to be solved.
[0003] Traditional message processing methods usually lack effective management and coordination mechanisms, and communication between systems directly relies on point-to-point connections, which leads to a high degree of system coupling and limited scalability and flexibility. When the system is small and the message volume is not large, simple message delivery may be able to cope with it. However, for a large number of concurrent messages, the system lacks effective sorting and priority processing strategies, which may lead to delayed processing of key messages, affecting the real-time and responsiveness of the system. Summary of the invention
[0004] The present invention provides a business message consumption method, device, equipment and storage medium to optimize the performance of a message queue and achieve effective management of business messages.
[0005] According to one aspect of the present invention, a service message consumption method is provided, the method comprising:
[0006] Get the customer package and create a topic in the current business service based on the customer package;
[0007] Use the client package to monitor messages based on topics to capture target business messages and obtain custom annotations corresponding to the target business messages;
[0008] Determine the target consumption message according to the custom annotation and send the target consumption message through the tool class.
[0009] Optionally, creating a topic for the current business service based on the customer package includes: identifying current business environment information of the current business service through the customer package, wherein the current business environment information includes the service environment and the service name; creating a topic in the message queue of the current business service according to the current business environment information.
[0010] Optionally, creating a topic in the message queue of the current business service based on the current business environment information, including: obtaining a topic configuration list, wherein the topic configuration list includes topic configuration information of each business environment information object; matching the current business environment information through the topic configuration list to obtain target topic configuration information corresponding to the current business environment information; and creating a topic in the message queue of the current business service based on the target topic configuration information.
[0011] Optionally, message monitoring is performed based on the topic through the client package to capture the target business message and obtain the custom annotation corresponding to the target business message, including: message monitoring of the topic's message queue through the client package to capture the target business message; obtaining the target business method corresponding to the target business message, wherein the target business method includes the custom annotation.
[0012] Optionally, after obtaining the custom annotation corresponding to the target business message, the method also includes: verifying the validity of the custom annotation and generating a verification result, wherein the verification result includes verification passed and verification failed; when the verification result is verification failed, generating a prompt message according to the target business message.
[0013] Optionally, determining a target consumption message according to a custom annotation includes: performing entity reflection on the custom annotation to determine a consumption type and a consumption entity declared in the custom annotation; and determining a target consumption message according to the custom annotation and the consumption entity.
[0014] Optionally, sending the target consumption message through the tool class includes: encapsulating the target consumption message through the tool class to generate an encapsulated target consumption message; and sending the encapsulated target consumption message according to the consumption type.
[0015] According to another aspect of the present invention, a service message consumption device is provided, the device comprising:
[0016] Theme creation module is used to obtain customer packages and create a theme in the current business service based on the customer packages;
[0017] A business message capture module, used to monitor messages based on the subject through a client package to capture target business messages and obtain custom annotations corresponding to the target business messages;
[0018] The business message consumption module is used to determine the target consumption message based on the custom annotation and send the target consumption message through the tool class.
[0019] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0020] at least one processor;
[0021] and a memory communicatively coupled to the at least one processor;
[0022] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute a service message consumption method described in any embodiment of the present invention.
[0023] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a service message consumption method described in any embodiment of the present invention when executed.
[0024] The technical solution of the embodiment of the present invention provides a unified message publishing and subscription standard. There is no need to write related operations for monitoring topics. Only the client package needs to be introduced to automatically create and monitor related topics according to the service environment and service name. Through custom annotation reflection, the satisfied messages in the message queue are automatically consumed to complete the one-to-one binding of business services and topics, which can achieve more efficient and stable message transmission, help different business modules to work better together, and improve the operating efficiency and performance of the entire business system.
[0025] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0027] Figure 1 This is a flow chart of a service message consumption method provided according to the first embodiment of the present invention;
[0028] Figure 2 is a flowchart of another service message consumption method provided according to Embodiment 2 of the present invention;
[0029] Figure 3 This is a schematic diagram of the structure of a service message consumption device provided according to Embodiment 3 of the present invention;
[0030] Figure 4 It is a structural diagram of an electronic device for implementing a service message consumption method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0031] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0033] Embodiment 1
[0034] Figure 1 A flowchart of a service message consumption method is provided for the first embodiment of the present invention. This embodiment is applicable to the publish-subscribe scenario of message queues in business services. The method can be executed by a service message consumption device. The service message consumption device can be implemented in the form of hardware and / or software. The service message consumption device can be configured in a computer controller. Figure 1 As shown, the method includes:
[0035] S110: Obtain a customer package, and create a topic in the current business service based on the customer package.
[0036] Among them, the client package refers to a collection of codes related to the customer. The client package may contain the customer's basic information, data related to business needs, specific settings, etc., and is an important basis for business processing for specific customers. Topic refers to the identification or classification in a messaging or event-driven system. By defining topics, related messages or events can be classified so that different types of messages can be distinguished and processed through specific topics. For example, business services of different customers can have different topics to process and manage related messages in a targeted manner. In actual applications, each business service can interact with each other by introducing client packages.
[0037] Specifically, the controller can read the data structure related to a specific customer from the database, or load a pre-defined customer package file from the file system to obtain the customer package. Creating a topic is to set a clear identifier for a specific business process or function in the current business service. The creation of a topic can be based on key information in the customer package, such as the customer's ID, business type, etc. By creating a topic, the business of different customers can be distinguished, which is convenient for subsequent message processing and management. The controller refers to the computer controller that runs the business service.
[0038] Optionally, creating a topic for the current business service based on the customer package includes: identifying current business environment information of the current business service through the customer package, wherein the current business environment information includes the service environment and the service name; creating a topic in the message queue of the current business service according to the current business environment information.
[0039] Among them, the service environment may include the production environment, test environment, development environment, etc. There are specific identifiers or parameters in the customer package to indicate the service environment in which the current business is running. For example, there may be a field in the customer package marked "environment = production" to indicate the production environment. By reading the field, the controller can accurately identify the service environment in which the current business service is located. The service name is usually a unique identifier for a specific business service. The customer package may contain service name information related to a specific customer, or the service name can be inferred through information such as the business type and customer needs in the customer package. For example, if the customer package indicates that the customer is using a loan service in a financial business, the service name may be "Financial Loan Service".
[0040] Specifically, when the system identifies the current business environment information, it can create a topic in the message queue based on this information. For example, if the service environment is a production environment and the service name is "Financial Loan Service", you can create a topic called "Production Environment-Financial Loan Service". The controller can create a new topic by calling the message queue API or through a configuration file. When creating a topic, you can also set the attributes of the topic, such as persistence, message expiration time, etc., to meet the needs of different business scenarios.
[0041] Optionally, creating a topic in the message queue of the current business service based on the current business environment information, including: obtaining a topic configuration list, wherein the topic configuration list includes topic configuration information of each business environment information object; matching the current business environment information through the topic configuration list to obtain target topic configuration information corresponding to the current business environment information; and creating a topic in the message queue of the current business service based on the target topic configuration information.
[0042] Among them, the topic configuration list is a collection of topic configuration information containing various business environment information objects. After obtaining the topic configuration list, the controller will compare and match the current business environment information with each business environment information object in the list. For example, if the current business environment information is "financial services" in the production environment, the controller will traverse each record in the topic configuration list, looking for topic configuration information related to the production environment and financial services. After finding the target topic configuration information corresponding to the current business environment information, it can create a topic in the message queue of the current business service according to the target topic configuration information.
[0043] S120 . Message monitoring is performed based on the subject through the client package to capture the target business message and obtain the custom annotation corresponding to the target business message.
[0044] Among them, message monitoring refers to the process of continuously monitoring specific data sources (such as message queues, event buses, etc.) to discover messages or events that meet specific conditions. The controller will continuously check whether new messages have arrived through message monitoring and process them according to preset rules. Custom annotations refer to a tag defined by the developer to mark specific elements in the code. Custom annotations can carry specific information for specific processing at runtime or compile time. Target consumption messages refer to messages that need to be processed after screening and determination.
[0045] Optionally, message monitoring is performed based on the topic through the client package to capture the target business message and obtain the custom annotation corresponding to the target business message, including: message monitoring of the topic's message queue through the client package to capture the target business message; obtaining the target business method corresponding to the target business message, wherein the target business method includes the custom annotation.
[0046] Among them, the client package usually contains configuration information and business logic related to a specific client. When monitoring messages, the client package can be used to determine the message queue that needs to be monitored and the rules and parameters of the monitoring.
[0047] Specifically, the client package stores the connection information of the message queue used by the current business service, such as the address, port number, queue name, etc. of the message queue. By reading the connection information, the system can establish a connection with a specific message queue and start listening to the messages in it. By listening to the message queue, the controller can obtain new messages in real time and process them according to business needs. During the message processing process, the controller can obtain the target business method corresponding to the target business message and extract custom annotations from the target business method.
[0048] Optionally, after obtaining the custom annotation corresponding to the target business message, the method also includes: verifying the validity of the custom annotation and generating a verification result, wherein the verification result includes verification passed and verification failed; when the verification result is verification failed, generating a prompt message according to the target business message.
[0049] It should be noted that problems may occur in the use of custom annotations due to various reasons, such as incorrect annotation parameter settings, inappropriate annotation application objects, etc. In order to ensure that the system can correctly process the target business messages with custom annotations, the validity of the custom annotations needs to be verified.
[0050] Specifically, when validating custom annotations, you can check whether the various attributes of the annotations meet the expected format and value range, or check whether the annotations are applied to the correct code elements. If all the attributes of the annotations meet the requirements and are applied to the correct code elements, the validation result is passed. Otherwise, the validation result is failed. When the validation result is failed, the controller needs to generate prompt information so that developers can find the problem and handle it in time. The prompt information can include a detailed description of the reason for the failure of the validation and relevant information of the target business message to better locate the problem. For example, it can include the source, timestamp, key content, etc. of the business message. By promptly handling the failure of the validation, business errors and system failures caused by incorrect custom annotations can be avoided.
[0051] S130. Determine the target consumption message according to the custom annotation, and send the target consumption message through the tool class.
[0052] Among them, the tool class refers to a class that contains a set of common functional methods, and the tool class is used to send target consumption messages.
[0053] Specifically, the controller will further determine how to consume messages in combination with custom annotations. Sending target consumption messages through tool classes can ensure that messages can be accurately and efficiently delivered to the target recipient. Tool classes usually provide a series of methods to handle message sending, including formatting messages, selecting appropriate communication protocols, etc.
[0054] The technical solution of the embodiment of the present invention provides a unified message publishing and subscription standard. There is no need to write related operations for monitoring topics. Only the client package needs to be introduced to automatically create and monitor related topics according to the service environment and service name. Through custom annotation reflection, the satisfied messages in the message queue are automatically consumed to complete the one-to-one binding of business services and topics, which can achieve more efficient and stable message transmission, help different business modules to work better together, and improve the operating efficiency and performance of the entire business system.
[0055] Embodiment 2
[0056] Figure 2 This is a flowchart of a business message consumption method provided in the second embodiment of the present invention. This embodiment adds a specific process of determining the target consumption message according to the custom annotation and subject, and sending the target consumption message through the tool class on the basis of the above-mentioned first embodiment. Among them, the specific contents of steps S210 and S220 are roughly the same as steps S110 and S120 in the first embodiment, so they will not be repeated in this embodiment. Figure 2 As shown, the method includes:
[0057] S210: Obtain a customer package, and create a topic in the current business service based on the customer package.
[0058] Optionally, creating a topic for the current business service based on the customer package includes: identifying current business environment information of the current business service through the customer package, wherein the current business environment information includes the service environment and the service name; creating a topic in the message queue of the current business service according to the current business environment information.
[0059] Optionally, creating a topic in the message queue of the current business service based on the current business environment information, including: obtaining a topic configuration list, wherein the topic configuration list includes topic configuration information of each business environment information object; matching the current business environment information through the topic configuration list to obtain target topic configuration information corresponding to the current business environment information; and creating a topic in the message queue of the current business service based on the target topic configuration information.
[0060] S220 . Message monitoring is performed based on the subject through the client package to capture the target business message and obtain the custom annotation corresponding to the target business message.
[0061] Optionally, message monitoring is performed based on the topic through the client package to capture the target business message and obtain the custom annotation corresponding to the target business message, including: message monitoring of the topic's message queue through the client package to capture the target business message; obtaining the target business method corresponding to the target business message, wherein the target business method includes the custom annotation.
[0062] Optionally, after obtaining the custom annotation corresponding to the target business message, the method also includes: verifying the validity of the custom annotation and generating a verification result, wherein the verification result includes verification passed and verification failed; when the verification result is verification failed, generating a prompt message according to the target business message.
[0063] S230 , perform entity reflection on the custom annotation to determine the consumption type and the consumption entity declared in the custom annotation.
[0064] Among them, entity reflection is the ability to inspect and manipulate objects at runtime. Through the reflection mechanism, you can obtain the properties, methods, and class information of the object. That is, through entity reflection, you can obtain the entity information marked by the annotation in the custom annotation. Specific attributes can be defined in the custom annotation to indicate the consumption type and related consumption entities.
[0065] Specifically, when reflecting on an object with a custom annotation, you can obtain the consumption type and the consumption entity declared in the custom annotation. The consumption type can indicate how the message is processed or used.
[0066] S240. Determine the target consumption message according to the custom annotation and the consumption entity.
[0067] Specifically, the target consumption message is constructed based on the information provided in the custom annotation and the actual consumption entity, with the purpose of delivering the correct message to the corresponding consumer for processing.
[0068] S250. Encapsulate the target consumption message through a tool class to generate an encapsulated target consumption message.
[0069] Specifically, encapsulating the target consumption message is to make the message more standardized, secure and easy to manage during transmission and processing. Encapsulation can include adding message header information, checksum, message sequence number, etc. Checksum can be used to detect whether the message is damaged during transmission to ensure the integrity of the message. The message sequence number can be used to ensure the order of the message, especially in a distributed system where multiple messages may be sent and received at the same time. The sequence number can help the receiver to sort and process the messages correctly. Through the encapsulation method of the tool class, the target consumption message can be automatically converted to the encapsulated format. The developer only needs to call the corresponding method of the tool class and pass in the target consumption message, and the tool class will return the encapsulated message.
[0070] S260. Send the encapsulated target consumption message according to the consumption type.
[0071] Among them, the consumption type plays an important guiding role in message processing. Different consumption types may correspond to different sending methods and processing logic.
[0072] Specifically, the tool class can choose the appropriate sending method according to the consumption type, such as using network communication or message queue mechanisms. When sending through network communication, socket programming or a specific network communication library can be used. The tool class will establish a connection with the receiver and send the encapsulated message. When sending through a message queue, the tool class can put the encapsulated message into a specific message queue and wait for the receiver to get the message from the queue. In addition, during the sending process, the tool class can also perform some additional processing, such as logging, performance monitoring, and error handling, to help developers understand the message sending status and promptly discover and solve problems.
[0073] Specific application scenario: In this implementation, the use of coupons and experience letters is used as an example to illustrate. After the user registers, business service A needs to send business service B. Business service B needs to asynchronously add coupons and experience letters under the user account. Traditionally, it is necessary to create different business topics for coupons and experience letters separately, and business service B listens to the two topics to process the business. The present invention only requires A and B to introduce the corresponding customer packages, and business service B will create a topic similar to dev_B and listen. After business service A uses the tool class to send coupons and experience letters to create messages to the topic of dev_B, business service B only needs to process two methods of coupons and experience letters. Custom annotations are used on the methods to indicate the consumption type, and the specified type of message consumption can be obtained from the message queue.
[0074] The technical solution of the embodiment of the present invention provides a unified message publishing and subscription standard. There is no need to write related operations for monitoring topics. Only the client package needs to be introduced to automatically create and monitor related topics according to the service environment and service name. Through custom annotation reflection, the satisfied messages in the message queue are automatically consumed to complete the one-to-one binding of business services and topics, which can achieve more efficient and stable message transmission, help different business modules to work better together, and improve the operating efficiency and performance of the entire business system.
[0075] Embodiment 3
[0076] Figure 3 This is a schematic diagram of the structure of a service message consumption device provided in Embodiment 3 of the present invention. Figure 3 As shown, the device includes: a theme creation module 310, which is used to obtain a customer package and create a theme in the current business service based on the customer package;
[0077] The business message capture module 320 is used to monitor messages based on the subject through the client package to capture the target business message and obtain the custom annotation corresponding to the target business message;
[0078] The business message consumption module 330 is used to determine the target consumption message according to the custom annotation and send the target consumption message through the tool class.
[0079] Optionally, the topic creation module 310 specifically includes: a business environment information identification unit, used to: identify the current business environment information of the current business service through the customer package, wherein the current business environment information includes the service environment and the service name; a topic creation unit, used to: create a topic in the message queue of the current business service according to the current business environment information.
[0080] Optionally, a topic creation unit is specifically used to: obtain a topic configuration list, wherein the topic configuration list includes topic configuration information of each business environment information object; match the current business environment information through the topic configuration list to obtain target topic configuration information corresponding to the current business environment information; and create a topic in the message queue of the current business service according to the target topic configuration information.
[0081] Optionally, the business message capture module 320 is specifically used to: monitor the message queue of the subject through the client package to capture the target business message; obtain the target business method corresponding to the target business message, wherein the target business method includes a custom annotation.
[0082] Optionally, the device also includes: an annotation verification module, which is used to verify the validity of the custom annotation after monitoring the message of the current business service through the client package to capture the target business message, and generate a verification result, wherein the verification result includes verification passed and verification failed; when the verification result is verification failed, a prompt message is generated according to the target business message.
[0083] Optionally, the business message consumption module 330 specifically includes: a target consumption message determination unit, which is used to: perform entity reflection on the custom annotation to determine the consumption type and the consumption entity declared in the custom annotation; and determine the target consumption message according to the custom annotation and the consumption entity.
[0084] Optionally, the business message consumption module 330 specifically includes: a target consumption message sending unit, which is used to: encapsulate the target consumption message through a tool class to generate an encapsulated target consumption message; and send the encapsulated target consumption message according to the consumption type.
[0085] The technical solution of the embodiment of the present invention provides a unified message publishing and subscription standard. There is no need to write related operations for monitoring topics. Only the client package needs to be introduced to automatically create and monitor related topics according to the service environment and service name. Through custom annotation reflection, the satisfied messages in the message queue are automatically consumed to complete the one-to-one binding of business services and topics, which can achieve more efficient and stable message transmission, help different business modules to work better together, and improve the operating efficiency and performance of the entire business system.
[0086] A service message consumption device provided in an embodiment of the present invention can execute a service message consumption method provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.
[0087] Embodiment 4
[0088] Figure 4 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0089] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0090] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0091] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a service message consumption method.
[0092] In some embodiments, a service message consumption method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the service message consumption method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute a service message consumption method in any other appropriate manner (e.g., by means of firmware).
[0093] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0094] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0095] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0096] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0097] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0098] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0099] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0100] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A business message consumption method, characterized in that: include: Obtain a customer package, and create a topic in the current business service based on the customer package; Performing message monitoring based on the subject through the client package to capture target business messages and obtain custom annotations corresponding to the target business messages; The target consumption message is determined according to the custom annotation, and the target consumption message is sent through the tool class.
2. The method according to claim 1, characterized in that The creating a theme for the current business service based on the customer package includes: Identify the current business environment information of the current business service through the client package, wherein the current business environment information includes the service environment and the service name; A topic is created in a message queue of the current business service according to the current business environment information.
3. The method according to claim 2, characterized in that The creating a topic in the message queue of the current business service according to the current business environment information includes: Obtaining a subject configuration list, wherein the subject configuration list includes subject configuration information of each business environment information object; Matching the current business environment information through the subject configuration list to obtain target subject configuration information corresponding to the current business environment information; A topic is created in the message queue of the current business service according to the target topic configuration information.
4. The method according to claim 1, characterized in that The message monitoring based on the subject by the client package to capture the target business message and obtain the custom annotation corresponding to the target business message includes: Monitoring the message queue of the topic through the client package to capture target business messages; A target business method corresponding to the target business message is obtained, wherein the target business method includes a custom annotation.
5. The method according to claim 1, characterized in that After obtaining the custom annotation corresponding to the target business message, the method further includes: Verifying the validity of the custom annotation and generating a verification result, wherein the verification result includes verification passed and verification failed; When the verification result is that the verification fails, a prompt message is generated according to the target service message.
6. The method according to claim 3, characterized in that The determining the target consumption message according to the custom annotation includes: Performing entity reflection on the custom annotation to determine the consumption type and the consumption entity declared in the custom annotation; The target consumption message is determined according to the custom annotation and the consumption entity.
7. The method according to claim 6, characterized in that The sending of the target consumption message through a tool class includes: Encapsulating the target consumption message through a tool class to generate an encapsulated target consumption message; The encapsulated target consumption message is sent according to the consumption type.
8. A service message consumption device, characterized in that: include: A theme creation module, used to obtain a customer package and create a theme in the current business service based on the customer package; A business message capture module, used to monitor messages based on the subject through the client package to capture target business messages and obtain custom annotations corresponding to the target business messages; The business message consumption module is used to determine the target consumption message according to the custom annotation and send the target consumption message through the tool class.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1 to 7.
10. A computer storage medium, characterized in that: The computer storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method according to any one of claims 1 to 7 when executed.