Conditional grouping-based MQ message control method and device, equipment and storage medium
Through the MQ message control method of conditional packets, the problem of insufficient stability of message packets in payment asynchronous scenarios is solved, and refined message allocation and routing are realized, which improves the stability and reliability of the system.
Patent Information
- Application Number
- CN202411259127.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2024-12-17
AI Technical Summary
In the payment asynchronous scenario in the digital finance field, the stability of MQ message packets is insufficient, resulting in unstable message delivery and affecting the normal operation of business processes.
Through the MQ message control method based on conditional grouping, the target condition configuration service is used to determine the custom strategy of the target middleware, bind producers, consumers and message queues, realize refined message allocation and routing, and support small-batch traffic verification and iteration. return.
It improves the stability of MQ message packets in payment asynchronous scenarios, ensures that producers and consumers obtain the latest configuration information in a timely manner, avoids message loss or duplication, and enhances the reliability and flexibility of the system.
Smart Images

Figure CN119155271A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology and is applied to the field of digital finance, and in particular to a method, device, equipment and storage medium for MQ message control based on conditional grouping. Background Art
[0002] With the rapid development of mobile payment technology in the field of digital finance, the increasing complexity of payment and settlement services and the expansion of the demands for asynchronous payment scenarios in the design of back-end technical solutions, the role of MQ cluster messaging functions in related business scenarios has become increasingly important, which has placed increasingly stringent requirements on the perception and impact of changes in messaging functions in actual production environments.
[0003] In the process of version iteration, before the transformation of the original message-related functions is put into production, sufficient function verification, regression and traffic pilot are required to ensure that the messages of the version iteration do not affect the original functions, and the messages of the new functions / function iterations can be consumed in a targeted manner. Therefore, several demands for message control are abstracted and summarized: 1. The generation of messages needs to be targeted and delivered according to conditions, and the nodes of conditional grouping can be flexibly adjusted; 2. When the message is consumed, it needs to be directed to different groups under different conditions to isolate messages with different business attributes. Therefore, how to improve the stability of MQ message grouping in payment asynchronous scenarios has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] The present application provides an MQ message control method, apparatus, device and storage medium based on conditional grouping to improve the stability of MQ message grouping in payment asynchronous scenarios.
[0005] In a first aspect, the present application provides an MQ message control method based on conditional grouping, the method comprising:
[0006] Configure services based on target conditions and determine the target MQ message customization strategy for the target middleware;
[0007] Determine the message queue binding relationship between the target producer, the target consumer and the target middleware according to the target MQ message customization strategy;
[0008] The target MQ message between the target producer and the target consumer is transmitted through the message queue binding relationship.
[0009] In a second aspect, the present application further provides an MQ message control device based on conditional grouping, the device comprising:
[0010] An MQ message customization strategy determination module is used to configure services based on target conditions and determine a target MQ message customization strategy for a target middleware;
[0011] A message queue binding relationship determination module is used to determine the message queue binding relationship between the target producer, the target consumer and the target middleware according to the target MQ message customization strategy;
[0012] The MQ message delivery module is used to deliver the target MQ message between the target producer and the target consumer through the message queue binding relationship.
[0013] In a third aspect, the present application also provides a computer device, comprising a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the above-mentioned conditional grouping-based MQ message control method when executing the computer program.
[0014] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the MQ message control method based on conditional grouping as described above.
[0015] The present application discloses a method, device, equipment and storage medium for MQ message control based on conditional grouping, wherein the method for MQ message control based on conditional grouping includes determining the target MQ message customization strategy of the target middleware based on the target condition configuration service; determining the message queue binding relationship between the target producer, the target consumer and the target middleware according to the target MQ message customization strategy; and transmitting the target MQ message between the target producer and the target consumer through the message queue binding relationship. In the above manner, the present application realizes the queue grouping governance in the MQ cluster through the conditional configuration service, and realizes refined directional message allocation. The transformed message production and consumption structure supports small batch traffic verification, customized scenario verification and iterative regression, providing better and more robust technical guarantees for asynchronous consumption in payment scenarios, ensuring that producers and consumers can obtain the latest configuration information in a timely manner, avoiding message loss or duplication, and improving the stability of MQ message grouping in payment asynchronous scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0017] Figure 1 is a schematic flow chart of an MQ message control method based on conditional grouping provided in the first embodiment of the present application;
[0018] Figure 2 is a schematic flow chart of an MQ message control method based on conditional grouping provided in the second embodiment of the present application;
[0019] Figure 3 A schematic block diagram of an MQ message control device based on conditional grouping provided in an embodiment of the present application;
[0020] Figure 4 A schematic block diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0021] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0022] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0023] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0024] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0025] The embodiments of the present application provide a method, device, equipment and storage medium for controlling MQ messages based on conditional grouping. Among them, the method for controlling MQ messages based on conditional grouping can be applied to a server, and through conditional configuration services, queue grouping management in an MQ cluster is realized, and refined directional message allocation is realized. The transformed message production and consumption structure supports small batch flow verification, customized scenario verification and iterative regression, providing better and more robust technical guarantees for asynchronous consumption in payment scenarios, ensuring that producers and consumers can obtain the latest configuration information in a timely manner, avoiding message loss or duplication, and improving the stability of MQ message grouping in payment asynchronous scenarios. Among them, the server can be an independent server or a server cluster.
[0026] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0027] See also Figure 1 , Figure 1 This is a schematic flow chart of an MQ message control method based on conditional grouping provided by the first embodiment of the present application. The MQ message control method based on conditional grouping can be applied to a server to implement queue grouping management in an MQ cluster and refined directional message allocation through conditional configuration services. The transformed message production and consumption structure supports small batch flow verification, customized scenario verification, and iterative regression, providing better and more robust technical support for asynchronous consumption in payment scenarios, ensuring that producers and consumers can obtain the latest configuration information in a timely manner, avoiding message loss or duplication, and improving the stability of MQ message grouping in payment asynchronous scenarios.
[0028] like Figure 1 As shown, the MQ message control method based on conditional grouping specifically includes steps S10 to S30.
[0029] Step S10: Determine the target MQ message customization strategy of the target middleware based on the target condition configuration service;
[0030] Specifically, the target MQ message customization strategy of the target middleware is determined. According to the characteristics and requirements of the payment scenario, this embodiment adopts an MQ message control method based on conditional grouping, supporting strategies such as environmental rules and hash conditions.
[0031] Step S20: Determine the message queue binding relationship between the target producer, the target consumer and the target middleware according to the target MQ message customization strategy;
[0032] Specifically, according to the target MQ message customization strategy, the message queue binding relationship between the target producer, target consumer and target middleware is determined. Specifically, this embodiment selects the producers and consumers of the same topic in a directional manner according to the environmental rules or hash conditions, and realizes the directional delivery and consumption of messages under different conditions.
[0033] Step S30: delivering the target MQ message between the target producer and the target consumer through the message queue binding relationship.
[0034] In one embodiment, the target MQ message customization strategy is determined according to the characteristics and requirements of the target middleware. According to the target MQ message customization strategy, the message queue binding relationship between the target producer, the target consumer and the target middleware is determined. Through the message queue binding relationship, the target MQ message between the target producer and the target consumer is transmitted, and the message queue binding relationship is regularly checked and refreshed to ensure its accuracy.
[0035] The target MQ message between the target producer and the target consumer is transmitted through the message queue binding relationship. Specifically, the producer service client and the consumer service client respectively introduce the corresponding SDK, perform the restart service node action of the initialization operation function, and produce and consume messages according to the message queue binding relationship. The message queue binding relationship is checked and refreshed regularly to ensure its accuracy. Specifically, this embodiment uses conditional configuration services to regularly push the latest configuration information to producers and consumers, and rebinds and reorders to ensure that producers and consumers can obtain the latest configuration information in a timely manner.
[0036] In the financial field, payment processing systems need to process a large number of transactions efficiently and reliably. Using the MQ message control method based on conditional grouping, messages can be grouped according to conditions such as transaction type, amount, user level, etc., ensuring that related transactions can be correctly routed to the corresponding processing queue.
[0037] Risk management and fraud detection in financial transactions require real-time processing and analysis of large amounts of data. Through conditional grouping, high-risk or suspicious transaction messages can be quickly routed to specialized detection systems for in-depth analysis.
[0038] Financial institutions need to manage a large number of user accounts and transaction records. Using MQ message control, messages can be distributed to different processing queues based on account activity, balance changes and other conditions to achieve personalized services and notifications.
[0039] This embodiment discloses a method, device, equipment and storage medium for MQ message control based on conditional grouping, wherein the method for MQ message control based on conditional grouping includes determining the target MQ message customization strategy of the target middleware based on the target condition configuration service; determining the message queue binding relationship between the target producer, the target consumer and the target middleware according to the target MQ message customization strategy; and transmitting the target MQ message between the target producer and the target consumer through the message queue binding relationship. In the above manner, the present application realizes the queue grouping governance in the MQ cluster through the conditional configuration service, and realizes refined directional message allocation. The transformed message production and consumption structure supports small batch traffic verification, customized scenario verification and iterative regression, providing better and more robust technical guarantees for asynchronous consumption in payment scenarios, ensuring that producers and consumers can obtain the latest configuration information in a timely manner, avoiding message loss or duplication, and improving the stability of MQ message grouping in payment asynchronous scenarios.
[0040] based on Figure 1 In the embodiment shown, in this embodiment, before step S10, the following steps are included:
[0041] Obtaining a preset middleware database and a preset condition configuration service of each preset middleware in the preset middleware database;
[0042] The target middleware is matched with each of the preset middlewares, and the preset condition configuration service corresponding to the preset middleware matching the target middleware is determined as the target condition configuration service.
[0043] In the specific embodiment, based on the Java language implementation, several major mainstream MQ middlewares support message consumption and production strategy customization. Messages are composed of message headers and message bodies. Message headers can be used to customize lightweight conditional configurations and are transmitted through various components in the production and consumption process.
[0044] Message middleware supports multi-node configuration of middleware, sorting between nodes, maintenance and periodic refresh, rebinding and re-sorting of node-client binding relationships.
[0045] Financial institutions often need to integrate multiple different systems and applications. By using preset condition configuration services, you can standardize the way different systems interact and ensure that data and messages can be exchanged according to unified rules. When processing a large number of transactions, transactions can be dynamically routed to different processing queues or services based on the type, priority or other conditions of the transaction. This helps to achieve load balancing and improve the overall performance and responsiveness of the system. Financial transactions need to be monitored in real time to identify potential risks. By matching preset condition configuration services, high-risk transactions can be quickly identified and routed to specialized risk management systems for further analysis.
[0046] See also Figure 2 , Figure 2 This is a schematic flow chart of an MQ message control method based on conditional grouping provided by the second embodiment of the present application. The MQ message control method based on conditional grouping can be applied to the server to support small batch traffic verification, customized scenario verification and iterative regression by transforming the message production and consumption structure, providing better and more robust technical guarantees for asynchronous consumption in payment scenarios, and dynamically adjusting the binding relationship between the delivery queue of the production message and the consumer, so as to flexibly respond to different business needs and traffic changes, and improve the reliability and flexibility of the system. Regularly refresh, rebind, and reorder to ensure that producers and consumers can obtain the latest configuration information in a timely manner, avoid message loss or duplication, and improve the stability and efficiency of the system.
[0047] based on Figure 1 The embodiment shown, this embodiment Figure 2 As shown, step S10 includes steps S101 to S103.
[0048] Step S101, determining the message delivery conditions between the target producer and the target middleware through the target condition configuration service;
[0049] Specifically, the target condition configuration service is used to determine the message delivery conditions between the target producer and the target middleware. According to the characteristics and requirements of the payment scenario, this embodiment adopts a strategy based on environmental rules and hash conditions to ensure the targeted delivery of messages.
[0050] Step S102: Determine the message consumption conditions of the target consumer and the target middleware through the target condition configuration service;
[0051] Specifically, the target condition configuration service is used to determine the message consumption conditions of the target consumer and the target middleware. Similarly, this embodiment adopts a strategy based on environmental rules and hash conditions to ensure the directional consumption of messages.
[0052] Step S103: Determine the target MQ message customization strategy according to the message delivery condition and the message consumption condition.
[0053] Specifically, the target MQ message customization strategy is determined according to the message delivery condition and the message consumption condition. Specifically, this embodiment selects the producers and consumers of the same topic in a directional manner according to the environmental rules or hash conditions, and implements directional delivery and consumption of messages under different conditions.
[0054] The message queue binding relationship is checked and refreshed regularly to ensure its accuracy. Specifically, this embodiment uses conditional configuration services to regularly push the latest configuration information to producers and consumers, and rebinds and reorders to ensure that producers and consumers can obtain the latest configuration information in a timely manner.
[0055] This embodiment discloses a method, device, equipment and storage medium for controlling MQ messages based on conditional grouping. The method for controlling MQ messages based on conditional grouping includes determining the message delivery conditions between the target producer and the target middleware through the target condition configuration service; determining the message consumption conditions between the target consumer and the target middleware through the target condition configuration service; determining the target MQ message customization strategy according to the message delivery conditions and the message consumption conditions; determining the message queue binding relationship between the target producer, the target consumer and the target middleware according to the target MQ message customization strategy; and transmitting the target MQ message between the target producer and the target consumer through the message queue binding relationship. In the above manner, this application realizes the queue grouping governance in the MQ cluster through the conditional configuration service, and realizes refined directional message allocation. The transformed message production and consumption structure supports small batch flow verification, customized scenario verification and iterative regression, providing better and more robust technical guarantees for asynchronous consumption in payment scenarios, ensuring that producers and consumers can obtain the latest configuration information in a timely manner, avoiding message loss or duplication, and improving the stability of MQ message grouping in payment asynchronous scenarios.
[0056] based on Figure 2 In the embodiment shown, in this embodiment, step S101 includes:
[0057] Calling the producer software development kit SDK of the target producer through the target condition configuration service;
[0058] Determine the business scenario of the target producer and the environmental attributes of the business scenario through the producer SDK;
[0059] Based on the business scenario and the environmental attributes, the message delivery condition is determined.
[0060] In one embodiment, (1) Conditional Configuration Service: Provides real-time configuration query to producers and consumers of the same title, and performs scheduled configuration push updates. Provides multiple delivery conditional configuration strategies:
[0061] 1. Environmental rules: Based on the current business payment scenario, you can set two types of environmental conditions, prod and gray, and perform message production and delivery strategies and consumer queue grouping and binding according to the environmental attributes of producers and consumers. Currently, the environmental rule conditions are used by default for setting and use.
[0062] 2. Hash condition: Perform hash calculation on each delivered message, match the consumer's node hash calculation according to the number of hash groups in the configuration (not exceeding the total number of queues in the middleware), and send it to the corresponding consumer node for consumption.
[0063] In this embodiment, the producer software development kit SDK of the target producer is called through the target condition configuration service. The SDK provides a set of APIs that can read the message delivery conditions issued by the condition configuration service.
[0064] The business scenario of the target producer and the environmental attributes of the business scenario are determined through the producer SDK. Specifically, this embodiment can set different environmental attributes according to business requirements and traffic changes, such as prod and gray environmental conditions.
[0065] Based on the business scenario and the environment attributes, the message delivery condition is determined. Specifically, this embodiment can adopt a strategy based on environment rules or hash conditions to ensure the targeted delivery of the message.
[0066] The message queue binding relationship is checked and refreshed regularly to ensure its accuracy. Specifically, this embodiment uses conditional configuration services to regularly push the latest configuration information to producers, and rebinds and reorders to ensure that producers can obtain the latest configuration information in a timely manner.
[0067] This embodiment discloses a method, device, equipment and storage medium for controlling MQ messages based on conditional grouping, wherein the method for controlling MQ messages based on conditional grouping includes calling the producer software development kit SDK of the target producer through the target condition configuration service; determining the business scenario of the target producer and the environmental attributes of the business scenario through the producer SDK; determining the message delivery conditions based on the business scenario and the environmental attributes; determining the message consumption conditions of the target consumer and the target middleware through the target condition configuration service; determining the target MQ message customization strategy according to the message delivery conditions and the message consumption conditions; determining the message queue binding relationship between the target producer, the target consumer and the target middleware according to the target MQ message customization strategy; and transmitting the target MQ message between the target producer and the target consumer through the message queue binding relationship. Through the above-mentioned method, the present application supports small batch flow verification, customized scenario verification and iterative regression by transforming the message production and consumption structure, providing better and more robust technical guarantees for asynchronous consumption in payment scenarios, dynamically adjusting the binding relationship between the delivery queue and the consumer of the production message, and can flexibly respond to different business needs and flow changes, thereby improving the reliability and flexibility of the system. Regularly refresh, rebind, and reorder to ensure that producers and consumers can obtain the latest configuration information in a timely manner, avoid message loss or duplication, and improve system stability and efficiency.
[0068] In a more preferred embodiment, step S20 includes:
[0069] Calling the consumer SDK of the target consumer, and calculating the consumer hash value of each consumer node in the target consumer through the consumer SDK;
[0070] Obtaining a preset delivery message of each target producer, and calculating a producer hash value of each preset delivery message;
[0071] The message queue binding relationship is determined based on each of the consumer hash values and each of the producer hash values.
[0072] In a more preferred embodiment, step S30 includes:
[0073] Reading the message queue binding relationship through the producer SDK, and determining the target message queue from the target middleware according to the message queue binding relationship;
[0074] The target MQ message is sent to the target message queue through the producer SDK, and the target MQ message is received by the target consumer SDK according to the message queue binding relationship.
[0075] Based on any of the above embodiments, in this embodiment, after step S30, the following steps are further included:
[0076] Detecting whether there is an unbound message queue in the target middleware for which the message queue binding relationship is not established;
[0077] In the case that the unbound message queue exists in the target middleware, the unbound message queue is bound to any one of the target producers and / or the target consumers.
[0078] Specifically, at the beginning of consumer instance creation, the message consumption conditions issued by the configuration service are read to perform middleware-queue binding; when the consumer destroys the instance / the number of instances in the cluster changes, the consumption conditions of the configuration service are still read to perform queue conditional binding and consumption. In the payment scenario, it is necessary to ensure that messages are not lost as much as possible. When no conditions are met, the queue and consumer will be randomly bound to avoid the situation where a queue is never consumed.
[0079] See also Figure 3 , Figure 3 The embodiment of the present application provides a schematic block diagram of an MQ message control device based on conditional grouping, and the MQ message control device based on conditional grouping is used to execute the aforementioned MQ message control method based on conditional grouping. The MQ message control device based on conditional grouping can be configured on a server.
[0080] like Figure 3 As shown, the MQ message control device 400 based on conditional grouping includes:
[0081] MQ message customization strategy determination module 410, configured to determine a target MQ message customization strategy of a target middleware based on target condition configuration services;
[0082] A message queue binding relationship determination module 420 is used to determine the message queue binding relationship between the target producer, the target consumer and the target middleware according to the target MQ message customization strategy;
[0083] The MQ message delivery module 430 is used to deliver the target MQ message between the target producer and the target consumer through the message queue binding relationship.
[0084] Furthermore, the MQ message control device 400 based on conditional grouping includes:
[0085] A preset condition configuration service acquisition module, used to acquire a preset middleware database and preset condition configuration services of each preset middleware in the preset middleware database;
[0086] The target condition configuration service determination module is used to match the target middleware with each of the preset middlewares, and determine the preset condition configuration service corresponding to the preset middleware matching the target middleware as the target condition configuration service.
[0087] Furthermore, the MQ message customization strategy determination module 410 includes:
[0088] A message delivery condition determination unit, configured to determine the message delivery condition between the target producer and the target middleware through the target condition configuration service;
[0089] A message consumption condition determination unit, configured to determine the message consumption condition between the target consumer and the target middleware through the target condition configuration service;
[0090] The MQ message customization policy determination unit is used to determine the target MQ message customization policy according to the message delivery condition and the message consumption condition.
[0091] Furthermore, the message delivery condition determination unit includes:
[0092] The producer SDK calling subunit is used to call the producer software development kit SDK of the target producer through the target condition configuration service;
[0093] An environmental attribute determination subunit, used to determine the business scenario of the target producer and the environmental attributes of the business scenario through the producer SDK;
[0094] The message delivery condition determination subunit is used to determine the message delivery condition based on the business scenario and the environmental attributes.
[0095] Furthermore, the message queue binding relationship determination module 420 includes:
[0096] A consumer hash value calculation unit, used to call the consumer SDK of the target consumer, and calculate the consumer hash value of each consumer node in the target consumer through the consumer SDK;
[0097] A producer hash value calculation unit, used to obtain a preset delivery message of each target producer and calculate a producer hash value of each preset delivery message;
[0098] The message queue binding relationship determining unit is used to determine the message queue binding relationship based on each of the consumer hash values and each of the producer hash values.
[0099] Furthermore, the MQ message delivery module 430 includes:
[0100] A target message queue determining unit, configured to read the message queue binding relationship through the producer SDK, and determine the target message queue from the target middleware according to the message queue binding relationship;
[0101] The MQ message delivery unit is used to send the target MQ message to the target message queue through the producer SDK, and receive the target MQ message through the target consumer SDK according to the message queue binding relationship.
[0102] Furthermore, the MQ message control device 400 based on conditional grouping further includes:
[0103] An unbound message queue detection module, used to detect whether there is an unbound message queue in the target middleware for which the message queue binding relationship is not established;
[0104] The unbound message queue binding module is used to bind the unbound message queue with any of the target producers and / or the target consumers when the unbound message queue exists in the target middleware.
[0105] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device and each module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0106] The above-mentioned device can be implemented in the form of a computer program. Figure 4 Runs on the computer device shown.
[0107] See also Figure 4 , Figure 4 1 is a schematic block diagram of a computer device provided in an embodiment of the present application. The computer device may be a server.
[0108] See also Figure 4 The computer device includes a processor, a memory and a network interface connected through a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
[0109] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any MQ message control method based on conditional grouping.
[0110] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0111] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any MQ message control method based on conditional grouping.
[0112] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0113] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0114] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[0115] Configure services based on target conditions and determine the target MQ message customization strategy for the target middleware;
[0116] Determine the message queue binding relationship between the target producer, the target consumer and the target middleware according to the target MQ message customization strategy;
[0117] The target MQ message between the target producer and the target consumer is transmitted through the message queue binding relationship.
[0118] In one embodiment, the target condition configuration service is used to implement the following before determining the target MQ message customization strategy of the target middleware:
[0119] Obtaining a preset middleware database and a preset condition configuration service of each preset middleware in the preset middleware database;
[0120] The target middleware is matched with each of the preset middlewares, and the preset condition configuration service corresponding to the preset middleware matching the target middleware is determined as the target condition configuration service.
[0121] In one embodiment, based on the target condition configuration service, the target MQ message customization strategy of the target middleware is determined to achieve:
[0122] Determine the message delivery conditions between the target producer and the target middleware through the target condition configuration service;
[0123] Determine the message consumption conditions of the target consumer and the target middleware through the target condition configuration service;
[0124] The target MQ message customization strategy is determined according to the message delivery condition and the message consumption condition.
[0125] In one embodiment, the message delivery conditions between the target producer and the target middleware are determined through the target condition configuration service to achieve:
[0126] Calling the producer software development kit SDK of the target producer through the target condition configuration service;
[0127] Determine the business scenario of the target producer and the environmental attributes of the business scenario through the producer SDK;
[0128] Based on the business scenario and the environmental attributes, the message delivery condition is determined.
[0129] In one embodiment, according to the target MQ message customization strategy, the message queue binding relationship between the target producer, the target consumer and the target middleware is determined to achieve:
[0130] Calling the consumer SDK of the target consumer, and calculating the consumer hash value of each consumer node in the target consumer through the consumer SDK;
[0131] Obtaining a preset delivery message of each target producer, and calculating a producer hash value of each preset delivery message;
[0132] The message queue binding relationship is determined based on each of the consumer hash values and each of the producer hash values.
[0133] In one embodiment, the target MQ message between the target producer and the target consumer is transmitted through the message queue binding relationship to achieve:
[0134] Reading the message queue binding relationship through the producer SDK, and determining the target message queue from the target middleware according to the message queue binding relationship;
[0135] The target MQ message is sent to the target message queue through the producer SDK, and the target MQ message is received by the target consumer SDK according to the message queue binding relationship.
[0136] In one embodiment, after the target MQ message between the target producer and the target consumer is transmitted through the message queue binding relationship, it is used to achieve:
[0137] Detecting whether there is an unbound message queue in the target middleware for which the message queue binding relationship is not established;
[0138] In the case that the unbound message queue exists in the target middleware, the unbound message queue is bound to any one of the target producers and / or the target consumers.
[0139] A computer-readable storage medium is also provided in an embodiment of the present application, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and the processor executes the program instructions to implement any one of the conditional grouping-based MQ message control methods provided in the embodiments of the present application.
[0140] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Medi a Card, SMC), a secure digital (Secure Digital, SD) card, a flash memory card (Flash Card), etc., equipped on the computer device.
[0141] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A MQ message control method based on conditional grouping, characterized in that: include: Configure services based on target conditions and determine the target MQ message customization strategy for the target middleware; Determine the message queue binding relationship between the target producer, the target consumer and the target middleware according to the target MQ message customization strategy; The target MQ message between the target producer and the target consumer is transmitted through the message queue binding relationship.
2. The MQ message control method based on conditional grouping according to claim 1, characterized in that: The target condition-based configuration service, before determining the target MQ message customization strategy of the target middleware, includes: Obtaining a preset middleware database and a preset condition configuration service of each preset middleware in the preset middleware database; The target middleware is matched with each of the preset middlewares, and the preset condition configuration service corresponding to the preset middleware matching the target middleware is determined as the target condition configuration service.
3. The MQ message control method based on conditional grouping according to claim 1, characterized in that: The target condition-based configuration service determines the target MQ message customization strategy of the target middleware, including: Determine the message delivery conditions between the target producer and the target middleware through the target condition configuration service; Determine the message consumption conditions of the target consumer and the target middleware through the target condition configuration service; The target MQ message customization strategy is determined according to the message delivery condition and the message consumption condition.
4. The MQ message control method based on conditional grouping according to claim 3, characterized in that: The determining of the message delivery condition between the target producer and the target middleware through the target condition configuration service includes: Calling the producer software development kit SDK of the target producer through the target condition configuration service; Determine the business scenario of the target producer and the environmental attributes of the business scenario through the producer SDK; Based on the business scenario and the environmental attributes, the message delivery condition is determined.
5. The MQ message control method based on conditional grouping according to claim 4, characterized in that: Determining the message queue binding relationship between the target producer, the target consumer and the target middleware according to the target MQ message customization strategy includes: Calling the consumer SDK of the target consumer, and calculating the consumer hash value of each consumer node in the target consumer through the consumer SDK; Obtaining a preset delivery message of each target producer, and calculating a producer hash value of each preset delivery message; The message queue binding relationship is determined based on each of the consumer hash values and each of the producer hash values.
6. The MQ message control method based on conditional grouping according to claim 5, characterized in that: The delivering the target MQ message between the target producer and the target consumer through the message queue binding relationship includes: Reading the message queue binding relationship through the producer SDK, and determining the target message queue from the target middleware according to the message queue binding relationship; The target MQ message is sent to the target message queue through the producer SDK, and the target MQ message is received by the target consumer SDK according to the message queue binding relationship.
7. The MQ message control method based on conditional grouping according to any one of claims 1 to 6, characterized in that: After the target MQ message between the target producer and the target consumer is transmitted through the message queue binding relationship, the method includes: Detecting whether there is an unbound message queue in the target middleware for which the message queue binding relationship is not established; In the case that the unbound message queue exists in the target middleware, the unbound message queue is bound to any one of the target producers and / or the target consumers.
8. An MQ message control device based on conditional grouping, characterized in that: include: An MQ message customization strategy determination module is used to configure services based on target conditions and determine a target MQ message customization strategy for a target middleware; A message queue binding relationship determination module is used to determine the message queue binding relationship between the target producer, the target consumer and the target middleware according to the target MQ message customization strategy; The MQ message delivery module is used to deliver the target MQ message between the target producer and the target consumer through the message queue binding relationship.
9. A computer device, characterized in that: The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is used to execute the computer program and implement the MQ message control method based on conditional grouping according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the MQ message control method based on conditional grouping according to any one of claims 1 to 7.
