Message queue platform migration method and device

The method and device facilitate flexible and reliable migration of message queues by determining message ratios for seamless transition between MQ platforms, addressing the challenge of platform changes without code modifications.

CN119226009APending Publication Date: 2024-12-31CHINABANK PAYMENT (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411388297.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

Existing application systems face challenges in seamlessly migrating from one MQ middleware platform to another, requiring significant code modifications and lacking flexibility in message transmission during platform changes.

Method used

A method and device for message queue platform migration that determines a first and second ratio of messages sent to the original and new platforms, allowing seamless migration without modifying producer or consumer code, using modes like dual-write, dual-read, and slicing to manage message distribution.

Benefits of technology

Enables flexible and reliable migration of message queues between platforms, reducing the need for code changes and ensuring continuous message processing without interruptions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119226009A_ABST
    Figure CN119226009A_ABST
Patent Text Reader

Abstract

The invention discloses a message queue platform migration method and device, and relates to the technical field of message transmission. A specific embodiment of the method comprises the steps of obtaining a message migration mode, wherein the message migration mode is used for determining a first proportion of sending a message to an original message queue platform and a second proportion of sending the message to a new message queue platform; and sending the obtained message sent by the producer side to the new message queue platform and / or the original message queue platform based on the message migration mode. According to the embodiment, the flexibility of message queue platform migration is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, specifically to the field of message transmission technology, and in particular to a message queue platform migration method and device. Background Art

[0002] Currently, most application systems use MQ (Message Queue) middleware for system interaction, and there are many MQ platforms for MQ middleware, such as Kafka, RabbitMQ, etc.

[0003] With system changes or technology iterations, when the application system needs to replace the MQ middleware platform, the application system needs to add a series of sending and receiving methods of the new MQ platform in the business code. MQ has producers and consumers. At this time, the producer needs to implement the dual-platform sending function. The consumer needs to change the original platform consumption to the new platform consumption after the producer sends on the dual platforms to achieve the purpose of platform migration. This method requires the producer to improve the code for the new MQ platform, and after the improvement, only the fixed migration method can be used for MQ platform migration. Summary of the invention

[0004] Embodiments of the present application provide a message queue platform migration method, apparatus, device, and storage medium.

[0005] According to the first aspect, an embodiment of the present application provides a message queue platform migration method, the method comprising: obtaining a message migration mode, the message migration mode is used to determine a first ratio of messages sent to the original message queue platform and a second ratio of messages sent to a new message queue platform; based on the message migration mode, sending the acquired messages sent by the producer end to the new message queue platform and / or the original message queue platform.

[0006] According to the second aspect, an embodiment of the present application provides a message queue platform migration device, which includes: an acquisition unit and a sending unit, wherein the acquisition unit is configured to acquire a message migration mode, and the message migration mode is used to determine a first ratio of sending messages to an original message queue platform and a second ratio of sending messages to a new message queue platform; the sending unit is configured to send the acquired messages sent by the producer end to the new message queue platform and / or the original message queue platform based on the message migration mode.

[0007] According to the third aspect, an embodiment of the present application provides an electronic device, which includes one or more processors; a storage device, on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement a message queue platform migration method as in any embodiment of the first aspect.

[0008] According to a fourth aspect, an embodiment of the present application provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements a message queue platform migration method as in any embodiment of the first aspect.

[0009] According to a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements a message queue platform migration method as in any embodiment of the first aspect.

[0010] The present application obtains a message migration mode, and the message migration mode is used to determine a first ratio of messages sent to the original message queue platform and a second ratio of messages sent to the new message queue platform; based on the message migration mode, the messages sent by the acquired producer end are sent to the new message queue platform and / or the original message queue platform, that is, by connecting the producer end and the consumer end, and migrating the messages transmitted between the producer end and the consumer end from the original message queue platform to the original message queue platform according to the message migration mode. The message migration mode can include multiple types, which improves the flexibility of message queue platform migration.

[0011] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;

[0013] Figure 2 is a flow chart of an embodiment of a message queue platform migration method according to the present application;

[0014] Figure 3 is a flowchart of another embodiment of the message queue platform migration method according to the present application;

[0015] Figure 4 It is a schematic diagram of an application scenario of the message queue platform migration method according to the present application;

[0016] Figure 5 is a flow chart of an embodiment of a message queue platform migration device according to the present application;

[0017] Figure 6 It is a structural diagram of a computer system suitable for implementing a server in an embodiment of the present application. DETAILED DESCRIPTION

[0018] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0019] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0020] Figure 1 An exemplary system architecture 100 is shown to which an embodiment of the message queue platform migration method of the present application can be applied.

[0021] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0022] The terminal devices 101, 102, 103 interact with the server 105 via the network 104 to receive or send messages, etc. Various communication client applications may be installed on the terminal devices 101, 102, 103, for example, message queue platform migration applications, communication applications, etc.

[0023] Terminal devices 101, 102, 103 can be hardware or software. When terminal devices 101, 102, 103 are hardware, they can be various electronic devices with display screens, including but not limited to mobile phones and laptops. When terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, used to provide message queue platform migration services), or it can be implemented as a single software or software module. No specific limitation is made here.

[0024] The server 105 may be a server that provides various services, for example, obtaining a message migration mode, which is used to determine a first ratio of sending messages to the original message queue platform and a second ratio of sending messages to the new message queue platform; based on the message migration mode, the acquired message sent by the producer end is sent to the new message queue platform and / or the original message queue platform. This implementation improves the flexibility of message queue platform migration.

[0025] It should be noted that the server 105 can be hardware or software. When the server 105 is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server is software, it can be implemented as multiple software or software modules (for example, used to provide message queue platform migration services), or it can be implemented as a single software or software module. No specific limitation is made here.

[0026] It should be noted that the message queue platform migration method provided in the embodiment of the present disclosure can be executed by the server 105, or by the terminal devices 101, 102, 103, or by the server 105 and the terminal devices 101, 102, 103 cooperating with each other. Accordingly, the various parts (such as various units, sub-units, modules, sub-modules) included in the message queue platform migration device can be all set in the server 105, or all set in the terminal devices 101, 102, 103, or respectively set in the server 105 and the terminal devices 101, 102, 103.

[0027] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0028] Figure 2 The process 200 of an embodiment of a message queue platform migration method applicable to the present application is shown. In this embodiment, the message queue platform migration method includes the following steps:

[0029] Step 201: Obtain a message migration mode.

[0030] In this embodiment, the execution subject may obtain the message migration mode configured by the user locally, or may obtain the message migration mode from a remote server storing the message migration mode configured by the user, which is not limited in this application.

[0031] The message migration mode is used to determine a first ratio of messages sent to the original message queue platform (i.e., the message queue platform before migration) and a second ratio of messages sent to the new message queue platform (i.e., the message queue platform after migration). The message migration mode may include multiple modes, such as a slicing migration mode, a (single write) dual read mode, a dual write mode, and the like.

[0032] Here, the dual-write mode may include a dual-write single-read mode and a dual-write dual-read mode.

[0033] Among them, the message queue platform, namely the MQ platform, also known as the message middleware platform, MQ middleware platform, can be any existing technology or future development technology based on queue and messaging technology, which provides a supporting software system for application systems to provide synchronous or asynchronous, reliable message transmission in a network environment, such as Kafka, RabbitMQ, RocketMQ, etc. This application does not limit this.

[0034] Here, the value ranges of the first ratio and the second ratio are both 0 to 100%.

[0035] Step 202: Send the acquired message sent by the producer to the new message queue platform and / or the original message queue platform based on the message migration mode.

[0036] In this embodiment, the execution entity can obtain the message sent by the producer end to the original message queue platform based on the migration component proxy, and send the obtained message to the new message queue platform and / or the original message queue platform according to the message migration mode.

[0037] Here, the execution subject can further obtain the subject corresponding to the message sent by the producer, that is, topic.

[0038] Specifically, the original message queue platform is Kafka, and the new message queue platform is RabbitMQ. If the message migration mode is (single write) dual read mode, the first ratio can be determined to be 0 and the second ratio can be determined to be 100%. Based on the migration component, the execution subject can send the acquired messages sent by the producer and the topics corresponding to the messages to the queues of the corresponding topics in the original message queue platform according to the first ratio, and to the queues of the corresponding topics in the new message queue platform according to the second ratio, that is, all the acquired messages sent by the producer are sent to the new message queue platform.

[0039] Here, it should be pointed out that in order to realize that the migration component directly connects with the producer side (message sending) instead of the original message queue platform, that is, to avoid modifying the code on the producer side, the relevant producer class that connects with the producer side can be defined in the migration component.

[0040] In addition, in order to achieve direct connection between the migration component and the consumer side, relevant consumer classes that are connected to the consumer side can also be defined in the migration component.

[0041] The relevant producer class and the relevant consumer class defined in the migration component may be the same as the initial producer class and the initial consumer class in the original message queue platform.

[0042] Furthermore, in order to achieve the connection between the migration component and the original message queue platform, the initial producer class and the initial consumer class in the original message queue platform can be modified to obtain the modified initial producer class and the initial consumer class. The relevant producer class in the migration component can call the modified initial producer class for message transmission, and the consumer class in the migration component can call the modified initial consumer class for message transmission.

[0043] In some optional methods, the messages sent by the acquired producer end are sent to a new message queue platform and / or the original message queue platform based on the message migration mode, including: in response to determining that the message migration mode is a dual-write mode, determining that the first ratio and the second ratio are both 100%; and sending the messages sent by the acquired producer end according to the first ratio and the second ratio.

[0044] In this implementation, the execution subject may determine the message migration mode. If the message migration mode is a dual-write mode, ie, a dual-write single-read mode or a dual-write dual-read mode, it may be determined that both the first ratio and the second ratio are 100%.

[0045] Furthermore, the execution entity may send the acquired messages sent by the producer end to the original message queue platform and the new message queue platform according to the determined first ratio and second ratio.

[0046] Specifically, the original message queue platform is Kafka, and the new message queue platform is RabbitMQ. If the message migration mode is the dual-write dual-read mode, the first ratio can be determined to be 100% and the second ratio can be determined to be 100%. The execution subject can send the received message sent by the producer to the original message queue platform and the new message queue platform at the same time based on the migration component.

[0047] This implementation method determines that the first ratio and the second ratio are both 100% in response to determining that the message migration mode is the dual-write mode; the acquired messages sent by the producer end are sent according to the first ratio and the second ratio, thereby realizing the migration of the message queue platform when the message migration mode is the dual-write mode.

[0048] In some optional embodiments, the method further includes: monitoring the new message queue platform and the original message queue platform, and in response to monitoring that the new message queue platform or the original message queue platform receives a message, sending the received message to the module corresponding to the message queue platform on the consumer side for processing.

[0049] In this implementation method, the execution entity can monitor whether the new message queue platform and the original message queue platform have received the message based on the migration component. If it is monitored that the new message queue platform or the original message queue platform has received the message, the received message will be sent to the module corresponding to the message queue platform on the consumer side (i.e., the message processing module) for processing.

[0050] Among them, a monitoring class can be defined in the migration component, and the new message queue platform and the original message queue platform can be monitored through the monitoring class. The monitoring class can include a first monitoring class corresponding to the original message queue platform on the consumer side, and a second monitoring class corresponding to the new message queue platform.

[0051] Here, the consumer end may include only the module corresponding to the original message queue platform, or may include both the module corresponding to the new message queue platform and the module corresponding to the original message queue platform. This application does not limit this.

[0052] Specifically, the consumer side includes both modules corresponding to the new message queue platform and modules corresponding to the original message queue platform. If the execution subject monitors that the new message queue platform receives a message, the received message can be sent to the module corresponding to the new message queue platform on the consumer side for processing; if the execution subject monitors that the original message queue platform receives a message, the received message can be sent to the module corresponding to the original message queue on the consumer side for processing.

[0053] This implementation method monitors the new message queue platform and the original message queue platform, and in response to monitoring that the new message queue platform or the original message queue platform receives a message, sends the received message to the module corresponding to the message queue platform on the consumer side for processing, thereby realizing the monitoring of the new message queue platform and the original message queue platform, and ensuring that the messages on both platforms have been consumed.

[0054] In some optional methods, in response to monitoring that a new message queue platform or an original message queue platform receives a message, the received message is sent to a module corresponding to the consumer side and the message queue platform for processing, including: in response to monitoring that a new message queue platform receives a message, the received message is encapsulated, and the encapsulated message is sent to a module corresponding to the consumer side and the original message queue platform for processing.

[0055] In this implementation, the consumer side may only include the module corresponding to the original message queue platform. The execution subject may monitor the new message queue platform and the original message queue platform based on the migration component. If it is monitored that the original message queue platform receives a message, the received message may be directly sent to the module corresponding to the original message queue platform on the consumer side for processing; if it is monitored that the new message queue platform receives a message, the received message may be encapsulated to obtain the encapsulated message.

[0056] Furthermore, the execution subject may send the encapsulated message to a module corresponding to the original message queue on the consumer side for processing.

[0057] Among them, the encapsulated message matches the module corresponding to the original message queue platform on the consumer side.

[0058] This implementation method responds to monitoring that the new message queue platform has received a message, encapsulates the received message, and sends the encapsulated message to the module corresponding to the original message queue platform on the consumer side for processing. While ensuring that messages on both platforms have been consumed, there is no need to modify the consumer-side code, which reduces the probability of problems and ensures the reliability of the migration process.

[0059] Figure 3 A process 300 of another embodiment of a message queue platform migration method applicable to the present application is shown. In this embodiment, the message queue platform migration method includes the following steps:

[0060] Step 301: Obtain a message migration mode.

[0061] In this embodiment, the implementation details and technical effects of step 301 can refer to the description of step 201 and will not be repeated here.

[0062] Step 302: In response to determining that the message migration mode is the tangent migration mode, the sum of the first ratio and the second ratio is set to 1, and the second ratio is smaller than the first ratio.

[0063] In this embodiment, the execution subject may determine the acquired message migration mode. If the message migration mode is a tangential migration mode, the sum of the first ratio and the second ratio may be set to 1.

[0064] The first ratio may be greater than the second ratio, for example, the second ratio is 10% and the first ratio is 90%; the second ratio is 20% and the first ratio is 80%, etc., which is not limited in the present application.

[0065] Step 303, executing the cutting step.

[0066] In this embodiment, the execution entity may execute a cutting step, which may include: obtaining messages sent by the producer end, and sending the obtained messages according to a first ratio and a second ratio; in response to determining that the processing process of the new message queue platform for the received message meets the preset conditions and the second ratio is less than 100%, increasing the second ratio according to a preset step size, and continuing to execute the cutting step.

[0067] The preset step size may be set based on experience and actual needs, for example, 10%, 20%, etc., and this application does not limit this.

[0068] Specifically, if the message migration mode is the slicing migration mode, the execution subject can set the second ratio to 10% and the first ratio to 90%. Further, the execution subject can perform the slicing step, that is, obtain one or more messages sent by the producer end, and send the obtained messages according to the first ratio and the second ratio, that is, send the obtained messages to the new message queue platform at a ratio of 10%, and send them to the original message queue platform at a ratio of 90%. Further, if the processing process of the received message by the new message queue platform meets the preset conditions and the second ratio is less than 100%, the second ratio is increased according to the preset step size, for example, 10%, that is, the new second ratio is 20%, and the cutting step is continued, that is, the message sent by the producer is obtained, and the obtained message is sent according to the first ratio and the second ratio, that is, the obtained message is sent to the new message queue platform at a ratio of 20%, and is sent to the original message queue platform at a ratio of 80%. If the processing process of the received message by the new message queue platform meets the preset conditions, such as there is no abnormality in the processing process, and the second ratio is less than 100%, the second ratio is increased according to the preset step size, for example, 10%, that is, the new second ratio is 30%, and the cutting step is continued.

[0069] It should be noted that the slicing step may also include: in response to determining that the message processing process of the new message queue platform meets the preset conditions and the second ratio is equal to 100%, generating an instruction for completing all slicing.

[0070] Furthermore, after generating instructions for all the cuts to be completed, the dual-read state can be maintained, that is, the consumer side can continue to read messages from the new message queue platform and the original message queue platform, or the execution subject can continue to monitor the messages received by the new message queue platform and the original message queue platform, and send the messages received by the message queue platform to the consumer side until the messages obtained by the consumer side on the new message queue platform and the original message queue platform match. Furthermore, the execution subject can match the messages obtained by the consumer side on the new message queue platform and the original message queue platform, generate instructions for the completion of the migration, and stop monitoring the original message queue platform, that is, at this time, the consumer side and the producer side can only transmit messages based on the new message queue platform.

[0071] In some optional embodiments, the slicing step may also include: in response to determining that the processing of the received message by the new message queue platform does not meet the preset conditions, setting the second ratio to zero.

[0072] In this implementation, if the execution subject obtains the message sent by the producer, it can send the obtained message according to the first ratio and the second ratio. Furthermore, the execution subject can determine whether the processing process of the message queue platform for the received message meets the preset conditions. If it does not meet the preset conditions, the second ratio can be set to 0.

[0073] This implementation method sets the second ratio to zero in response to determining that the new message queue platform's processing of received messages does not meet preset conditions. When an exception occurs in the migration process, the original message queue platform can be promptly switched back to achieve rollback at any time, effectively reducing losses caused by the exception of the new platform.

[0074] from Figure 3 It can be seen that Figure 2 Compared with the corresponding embodiments, the process 300 of the message queue platform migration method in this embodiment embodies obtaining a message migration mode, and in response to determining that the message migration mode is a truncated migration mode, setting the sum of the first ratio and the second ratio to 1, and the second ratio is less than the first ratio, and executing the truncated step, that is, when the message migration mode is the truncated migration mode, gradually increasing the message migration ratio of the new message queue platform to achieve the purpose of smooth migration.

[0075] Continue to see Figure 4 , Figure 4 It is an application scenario diagram of the message queue platform migration method according to this embodiment.

[0076] exist Figure 4 In the scenario, the original message queue platform is Kafka, the new message queue platform is RabbitMQ, the message migration mode is the slicing migration mode, the migration components may include a first migration component and a second migration component, the execution subject may proxy the original message queue platform based on the first migration component to obtain the message sent by the producer end to the original message queue platform, and the first migration component may define the relevant producer class that interfaces with the producer end. Furthermore, the execution subject may set the first ratio to 100% and the second ratio to 0%, and perform the slicing step, that is, obtain one or more messages sent by the producer end, and send the obtained messages according to the first ratio and the second ratio, that is, send the obtained messages to the new message queue platform at a ratio of 0%, and send them to the original message queue platform at a ratio of 100%. Further, if the processing process of the received message by the new message queue platform meets the preset conditions, and the second ratio is less than 100%, the second ratio is increased according to the preset step size, for example, 10%, that is, the new second ratio is 10%, and the slicing step is continued, that is, the message sent by the producer is continued to be obtained, and the obtained message is sent according to the first ratio and the second ratio, that is, the obtained message is sent to the new message queue platform at a ratio of 10%, and sent to the original message queue platform at a ratio of 90%. If the processing process of the received message by the new message queue platform meets the preset conditions, and the second ratio is less than 100%, the second ratio is increased according to the preset step size, for example, 10%, that is, the new second ratio is 20%, and the slicing step is continued, and so on. If the processing process of the received message by the new message queue platform meets the preset conditions, and the second ratio is equal to 100%, an instruction for the completion of all slicing is generated.

[0077] Furthermore, the execution subject can monitor whether the new message queue platform and the original message queue platform receive messages based on the second migration component. The second migration component can define a monitoring class and a related consumer class that interfaces with the consumer end. If the original message queue platform receives a message, the received message is sent to the module corresponding to the original message queue on the consumer end through the related consumer class for processing. If the new message queue platform receives a message, the received message is encapsulated and the encapsulated message is sent to the module corresponding to the original message queue platform on the consumer end through the related consumer class for processing.

[0078] Further references Figure 5 As an implementation of the methods shown in the above figures, the present application provides an embodiment of a message queue platform migration device, and the device embodiment is similar to Figure 1 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0079] like Figure 5 As shown, the message queue platform migration device 500 of this embodiment includes: an acquisition unit 501 and a sending unit 502.

[0080] The acquiring unit 501 may be configured to acquire a message migration mode.

[0081] The sending unit 502 may be configured to send the acquired message sent by the producer to the new message queue platform and / or the original message queue platform based on the message migration mode.

[0082] In some optional modes of this embodiment, the sending unit is further configured to, in response to determining that the message migration mode is a truncation migration mode, set the sum of the first ratio and the second ratio to 1, and the second ratio is smaller than the first ratio; execute the truncation step, which may include: obtaining the message sent by the producer end, and sending the obtained message according to the first ratio and the second ratio; in response to determining that the processing process of the received message by the new message queue platform meets the preset conditions, and the second ratio is less than 100%, increase the second ratio according to the preset step size, and continue to execute the truncation step.

[0083] In some optional aspects of this embodiment, the slicing step may further include: in response to determining that the processing of the received message by the new message queue platform does not meet a preset condition, setting the second ratio to zero.

[0084] In some optional embodiments of this embodiment, the sending unit is further configured to, in response to determining that the message migration mode is a dual-write mode, determine that the first ratio and the second ratio are both 100%; and send the acquired message sent by the producer end according to the first ratio and the second ratio.

[0085] In some optional embodiments of this embodiment, the device also includes a monitoring unit, which is configured to monitor the new message queue platform and the original message queue platform, and in response to monitoring that the new message queue platform or the original message queue platform receives a message, send the received message to the module corresponding to the message queue platform on the consumer side for processing.

[0086] In some optional methods of this embodiment, the new message queue platform and the original message queue platform are monitored, and in response to monitoring that the new message queue platform or the original message queue platform receives a message, the received message is sent to the module corresponding to the consumer side and the message queue platform for processing, including: in response to monitoring that the new message queue platform receives a message, the received message is encapsulated, and the encapsulated message is sent to the module corresponding to the consumer side and the original message queue platform for processing.

[0087] It should be noted that the collection, collection, updating, analysis, processing, use, transmission, storage and other aspects of user personal information involved in the technical solution of this disclosure are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain the security of user personal information, network security and national security.

[0088] According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.

[0089] like Figure 6 , is a block diagram of an electronic device according to the message queue platform migration method of an embodiment of the present application.

[0090] 600 is a block diagram of an electronic device according to a message queue platform migration method of an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, 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 processing, cellular phones, smart phones, wearable devices, 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 application described herein and / or required.

[0091] like Figure 6As shown, the electronic device includes: one or more processors 601, a memory 602, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 601 is taken as an example.

[0092] The memory 602 is a non-transient computer-readable storage medium provided in the present application. The memory stores instructions executable by at least one processor to enable the at least one processor to execute the message queue platform migration method provided in the present application. The non-transient computer-readable storage medium of the present application stores computer instructions, which are used to enable a computer to execute the message queue platform migration method provided in the present application.

[0093] The memory 602 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the message queue platform migration method in the embodiment of the present application (for example, the attached Figure 5 The processor 601 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 602, that is, the message queue platform migration method in the above method embodiment is implemented.

[0094] The memory 602 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the use of the electronic device migrated by the message queue platform, etc. In addition, the memory 602 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 602 may optionally include a memory remotely arranged relative to the processor 601, and these remote memories may be connected to the electronic device migrated by the message queue platform via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0095] The electronic device of the message queue platform migration method may further include: an input device 603 and an output device 604. The processor 601, the memory 602, the input device 603 and the output device 604 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.

[0096] The input device 603 can receive input digital or character information, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a track ball, a joystick, and other input devices. The output device 604 may include a display device, an auxiliary lighting device (e.g., an LED), and a tactile feedback device (e.g., a vibration motor). The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display, and a plasma display. In some embodiments, the display device may be a touch screen.

[0097] Various implementations of the systems and techniques described herein can be realized in digital electronic circuit systems, integrated circuit systems, dedicated ASICs (application specific integrated circuits), 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.

[0098] These computer programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or means (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

[0099] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer 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 pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0100] The systems and techniques described herein may be implemented in a computing system that includes back-end 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 front-end 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 back-end components, middleware components, or front-end 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), and the Internet.

[0101] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.

[0102] According to the technical solution of the embodiment of the present application, the flexibility of message queue platform migration is improved.

[0103] 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 recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution disclosed in this application can be achieved, and this document is not limited here.

[0104] The above specific implementations do not constitute a limitation on the protection scope of this application. 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 modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.

Claims

1. A message queue platform migration method, the method comprising: Obtaining a message migration mode, where the message migration mode is used to determine a first ratio of sending messages to an original message queue platform and a second ratio of sending messages to a new message queue platform; Based on the message migration mode, the acquired message sent by the producer is sent to the new message queue platform and / or the original message queue platform.

2. The method according to claim 1, wherein: The sending of the acquired message sent by the producer end to the new message queue platform and / or the original message queue platform based on the message migration mode includes: In response to determining that the message migration mode is a tangent migration mode, setting the sum of the first ratio and the second ratio to 1, and setting the second ratio to be smaller than the first ratio; Execute a cutting step, the cutting step comprising: Obtaining messages sent by the producer, and sending the obtained messages according to the first ratio and the second ratio; In response to determining that the processing of the received message by the new message queue platform meets the preset conditions and the second ratio is less than 100%, the second ratio is increased according to a preset step size, and the cutting step is continued.

3. The method according to claim 2, wherein: The cutting step also includes: In response to determining that the processing of the received message by the new message queue platform does not meet a preset condition, the second ratio is set to zero.

4. The method according to claim 1, wherein: The sending of the acquired message sent by the producer end to the new message queue platform and / or the original message queue platform based on the message migration mode includes: In response to determining that the message migration mode is a dual-write mode, determining that the first ratio and the second ratio are both 100 percent; The acquired messages sent by the producer are sent according to the first ratio and the second ratio.

5. The method according to claim 1, further comprising: The new message queue platform and the original message queue platform are monitored, and in response to monitoring that the new message queue platform or the original message queue platform receives a message, the received message is sent to a module corresponding to the message queue platform on the consumer side for processing.

6. The method according to claim 5, wherein: In response to monitoring that the new message queue platform or the original message queue platform receives a message, sending the received message to a module corresponding to the message queue platform on the consumer side for processing, including: In response to monitoring that the new message queue platform receives a message, the received message is encapsulated and sent to the module corresponding to the original message queue platform on the consumer side for processing, and the encapsulated message is matched with the module corresponding to the original message queue platform on the consumer side.

7. A message queue platform migration device, the device comprising: an acquisition unit configured to acquire a message migration mode, wherein the message migration mode is used to determine a first ratio of sending messages to an original message queue platform and a second ratio of sending messages to a new message queue platform; The sending unit is configured to send the acquired message sent by the producer end to the new message queue platform and / or the original message queue platform based on the message migration mode.

8. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 6.