CN113626211A - Switching method and switching system of message queue, electronic equipment and storage medium - Google Patents

Switching method and switching system of message queue, electronic equipment and storage medium Download PDF

Info

Publication number
CN113626211A
CN113626211A CN202110725263.9A CN202110725263A CN113626211A CN 113626211 A CN113626211 A CN 113626211A CN 202110725263 A CN202110725263 A CN 202110725263A CN 113626211 A CN113626211 A CN 113626211A
Authority
CN
China
Prior art keywords
message
message queue
queue
target
consumer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110725263.9A
Other languages
Chinese (zh)
Inventor
张晓晔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Oudian Cloud Information Technology Jiangsu Co ltd
Original Assignee
Oudian Cloud Information Technology Jiangsu Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oudian Cloud Information Technology Jiangsu Co ltd filed Critical Oudian Cloud Information Technology Jiangsu Co ltd
Priority to CN202110725263.9A priority Critical patent/CN113626211A/en
Publication of CN113626211A publication Critical patent/CN113626211A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/547Messaging middleware
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a switching method, a switching system, electronic equipment and a storage medium of a message queue, wherein the method comprises the following steps: acquiring an interface example of a message queue; when the target message queue needs to be switched, calling an interface instance corresponding to the target message queue; the interface instance generates a corresponding message sender and a message consumer; the message sender sends the message to the target message queue, and the message consumer subscribes to the message in the target message queue. In the invention, when the current queue needs to be switched to the target message queue, only the interface instance corresponding to the target message queue needs to be called, the message sender and the message consumer can be generated through the interface instance, the message sender sends the message to the target message queue, and the message consumer subscribes the message in the target message queue, so that the requirements for docking different message queues can be met without changing service codes, adaptation can be rapidly developed, a plurality of sets of codes do not need to be developed and maintained, and the maintenance cost of the system is reduced.

Description

Switching method and switching system of message queue, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data communications, and in particular, to a method and a system for switching a message queue, an electronic device, and a storage medium.
Background
The use of the message queue is a common choice in distributed software development, and the purpose of the message queue is to borrow message queue middleware as a relay, and complete asynchronization of information notification between services by using a publish/subscribe mechanism provided by the message queue middleware, so that the coupling between services is reduced.
As shown in fig. 1, the business model using message queues mainly includes three components: message senders, message middleware, and message consumers. Where the Message middleware hosts a Message-transiting service, i.e., a Message Queue (MQ), a Message consumer may subscribe to a specified Queue on the Message Queue, and a Message sender sends a Message to the Message Queue. The asynchronization of communication between different services in current systems using message queues is based on this model, and there is no need for the consuming and providing parties of messages to be concerned about the status of each other, i.e. the sender does not need to know whether a message has been accepted.
On top of this model, the mainstream message queue may also contain various functions related to message sending/receiving, such as:
1) and multiple consumers can subscribe to the same queue, and all consumers subscribing the queue can receive the message after the message sender sends the message (share consumption).
2) And multiple consumers can subscribe to the same queue, and only one of the multiple consumers who subscribe to the queue after the message sender sends the message can receive the message (competitive consumption).
3) Before consuming the message, the consumer may define a restriction condition, and only messages satisfying the condition may be received (filtering messages).
Through the technology, communication between upstream and downstream services can be conveniently realized in the current distributed system by means of the message queue, and functions of shared consumption, competitive consumption, message filtering and the like are provided. However, in enterprise client-oriented software development, the use of a messaging model often faces situations that require changes to the implementation of a particular type of messaging middleware due to the client's customized requirements.
Once the message-capable middleware is selected, it is difficult to change, and in order to change the message-capable middleware, it is the mainstream to re-interface the new message-capable middleware based on the original code logic in the service.
For example, if a message queue of a type of RabbitMQ (a message queue) currently in use sends a code of consumption logic, and if switching to sending/consuming by using a message queue of a type of Kafka (a message queue) is needed, the code in the service code is modified in the original code, namely, all places using the RabbitMQ need to be modified into Kafka and then the code project needs to be maintained separately. There are two copies of code at this point using the RabbitMQ and using Kafka, and it is decided which one to use at deployment time.
Another solution is to use a message queue conforming to the JMS (JAVA message service application program interface) standard, in which only ActiveMQ (a kind of message queue) is fully conforming to its standard, but this solution is also a solution that is eliminated because the protocol specified by JMS does not support shared consumption and is not suitable for highly available, highly loaded scenarios.
To sum up, in the prior art, in the process of software development, when meeting the requirement of switching message queues, on one hand, rapid development adaptation cannot be achieved, and an engineer needs to spend additional time for docking, which increases the cost of human resources, and on the other hand, when the characteristics supported by each message middleware are different, it is difficult to achieve no influence on services.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a switching method, a switching system, an electronic device, and a storage medium for a message queue, which can rapidly develop a message queue without affecting a service and reduce a maintenance cost, in order to overcome the defects that in the software development process in the prior art, the development cannot be rapidly performed while a service is not affected when a need for switching the message queue is met, and the cost for maintaining a plurality of codes is high based on different message queues.
The invention solves the technical problems through the following technical scheme:
the invention provides a switching method of a message queue, which comprises the following steps:
acquiring interface instances of a message queue, wherein each interface instance corresponds to one type of message queue;
when the current message queue needs to be switched to a target message queue, calling an interface instance corresponding to the target message queue;
the interface instance generates a corresponding message sender and a message consumer;
and the message sender sends the message to the target message queue, and the message consumer subscribes to the message in the target message queue.
Preferably, the step of subscribing the message in the target message queue by the message consumer further comprises the following steps:
the message consumer creates a listener to listen for subscribed messages.
Preferably, the step of generating the corresponding message sender and message consumer by the interface instance further comprises the following steps:
creating a destination object;
the message sender sends a message to the target message queue, and the step of subscribing the message in the target message queue by the message consumer specifically comprises:
and the message sender sends a message to the target message queue referred by the destination object, and the consumer subscribes to the message in the target message queue referred by the destination object.
Preferably, the step of generating the corresponding message sender and message consumer by the interface instance further comprises the following steps:
and configuring connection information, wherein the connection information comprises the number of threads.
Preferably, the connection information further includes a message mode, and the message mode includes a competition consumption mode and/or a sharing consumption mode; and/or the presence of a gas in the gas,
the connection information further includes a message filtering policy.
Preferably, when the type of the target message queue is ActiveMQ and there are multiple consumers subscribing to the target message queue, the message pattern specifically includes the competitive consumption pattern to simulate a competitive consumption mechanism.
Preferably, when the type of the target message queue is Kafka, the connection information specifically includes the filtering policy to simulate a function of message filtering.
The invention also provides a switching system of the message queue, which comprises the following components: the system comprises an instance acquisition module, an interface instance calling module, an object generation module and a message transceiving module;
the instance acquisition module is used for acquiring interface instances of the message queues, and each interface instance corresponds to one type of message queue;
the interface instance calling module is used for calling an interface instance corresponding to a target message queue when the current message queue needs to be switched to the target message queue;
the object generation module is used for generating corresponding message senders and message consumers through the interface instances;
the message receiving and sending module is used for sending messages to the target message queue through the message sender, and the message consumer subscribes to the messages in the target message queue.
The invention also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the computer program to realize the message queue switching method.
The present invention also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of switching a message queue as described above.
The positive progress effects of the invention are as follows: the invention provides a standardized message queue operation interface, when needing to switch from the current message queue to the target message queue, only needing to call the interface instance corresponding to the target message queue, corresponding message senders and message consumers can be generated through corresponding interface instances, the message senders can send messages to target message queues, the message consumer can subscribe the message in the corresponding target message queue, on one hand, the application can meet the requirements of docking different message queues without changing the service code, can rapidly develop adaptation, reduce the resource cost, on the other hand, the invention can meet the characteristics supported by each message middleware, in addition, the invention does not need to develop and maintain a plurality of sets of codes by self, thereby greatly reducing the maintenance cost of the system in the subsequent service function upgrading process.
Drawings
FIG. 1 is a block diagram of a model for messaging through a message queue.
FIG. 2 is a block diagram illustrating data interaction between a message sender and a message consumer according to an embodiment of the present invention.
Fig. 3 is a schematic diagram of a butting relationship between modules in embodiment 1 of the present invention.
Fig. 4 is a flowchart of a method for switching a message queue according to embodiment 1.
Fig. 5 is a schematic block diagram of an electronic device in embodiment 3 of the present invention.
Detailed Description
In order to solve the problem that developers cannot switch the message queues docked in the existing service codes in a low-cost, standard and general manner due to different interfaces/characteristics provided by each specific implementation when using the message queues, the embodiment provides a standardized message queue interface, and a message queue switching method is realized based on the standardized message queue interface.
In the embodiment, the method is implemented by loading an Interface instance existing in the current program running environment through a Service discovery Interface (SPI) technology provided by a Java software Development Kit (JDK), so as to achieve the effect of conveniently and rapidly switching a specific docking message queue.
In this embodiment, different interface instances are used to interface with interfaces provided by the actual message queue, and are discovered and loaded by the SPI mechanism by introducing a program-dependent manner.
In this embodiment, a set of standardized operation message queue interfaces is defined, and specifically, the interfaces include a message consumer, a message sender, a message destination, a message listener, and a message entity.
As shown in FIG. 2, a message Destination, such as Destination, is specifically executed by a message sender by setting an internal parameter, such as name, to indicate where the message will be sent by the message sender.
The Message entity (Message) defines the content actually sent, all messages sent through the system are Message objects, the messages are serialized when being sent, and the messages are deserialized before being consumed.
The message sender (Producer) is created by a specific interface instance, provides a method for sending messages externally, interfaces a specific message queue interface by using a Software Development Kit (SDK) provided by the message queue, and decides to send the messages to a specific theme/queue of the MQ through the message destination.
The message Consumer (Consumer) is created by a specific interface instance, the specific message queue interface is connected through the SDK, and the Destination pointed by the Destination is monitored after the starting. And calling back the message listener when receiving the message delivered by the message queue.
Specifically, the consumer sets a sharing consumption or competition mode when creating the message queue, and the message queue is docked according to different message queues. In the case where the corresponding message queue does not support competing consumption, the cluster consumer simulates competition locally. And setting a message filtering strategy before the consumer processes the message, and carrying out butt joint according to different message queues. In the case where the corresponding message queue does not support, filtering is performed locally.
It should be understood that the message listener is defined by the service code itself after the consumer creates the message listener, and by setting the listener, the message can be called back to the listener for service logic processing when the message is received by the consumer.
In this embodiment, the flows of sending and receiving messages are all circulated through the unified interface, different interface instances are written/used through different message queues, and after integration is completed, switching between message queues is performed only by replacing corresponding program dependencies because the interfaces are the same, and service codes do not need to be modified.
The invention is further illustrated by the following examples, which are not intended to limit the scope of the invention.
Example 1
The present embodiment provides a method for switching a message queue, fig. 3 shows a schematic diagram of a docking relationship between modules in the present embodiment, and fig. 4 shows a flowchart of the switching method in the present embodiment, where the switching method in the present embodiment includes the following steps:
step 101, obtaining an interface instance of a message queue.
Wherein each interface instance corresponds to one type of message queue.
Wherein a drive manager (DriverManager) is used to obtain the drive. And in the case of initial loading of the DriverManager, triggering initialization logic, scanning out all interface instances contained in the program runtime by using an SPI interface ServiceLoader provided by JDK, and storing all the interface instances into a mapping relation table capable of finding specific interface instances by instance names.
In this embodiment, when the system is just started, the default interface instance configured by the current system may be obtained by the obtaining method provided by the drive manager, or the specified interface instance may be obtained by the name of the specified interface instance.
And 102, calling an interface instance corresponding to the target message queue when the current message queue needs to be switched to the target message queue.
Further, step 102 may further include the steps of: a destination object is created.
Step 102 specifically includes: the message sender sends the message to the target message queue referred by the destination object, and the consumer subscribes to the message in the target message queue referred by the destination object.
Further, step 102 may further include the steps of: configuring connection information, wherein the connection information includes the number of threads, message modes (such as competition consumption mode, sharing consumption mode, etc.), message filtering policies, and the like.
Step 103, the interface instance generates corresponding message sender and message consumer.
And step 104, the message sender sends the message to the target message queue, and the message consumer subscribes the message in the target message queue.
When the type of the target message queue corresponding to the interface instance is ActiveMQ, additional supplementary logic is needed by a creation consumer. The reason is that due to the nature of ActiveMQ itself, i.e., not supporting competitive consumption, one subscription topic only allows one same consumer to connect, and multiple consumers cannot subscribe to the same topic. Therefore, when multiple identical consumer clusters use the same destination object to acquire the same target message queue, the other clients except the connected client start a task thread to connect the ActiveMQ in the background. At this time, one of the clients will consume the message all the time, and when the client goes down, the other clients will complement the message, so as to simulate the competitive consumption mechanism.
In a particular embodiment, step 104 may be followed by the step of the message consumer creating a listener to listen for the subscribed messages.
Specifically, a message consumer creates a listener, customizes the consumed business logic, and then sets the listener in the consumer and starts the listener.
And when the consumer is started, the message sent by the target message queue is deserialized and is a customized standard message object after the message delivered by the target message queue is received.
In a specific implementation manner, when a target message queue to which a receiving instance is docked is Kafka, because Kafka does not support message filtering, after a corresponding message filtering policy is specified in the step of configuring connection information, a consumer stores the filtering policy in a program memory, performs matching in the memory when receiving a message, and cancels consumption if the filtering policy is not met, so that Kafka is delivered to other clients for retry again until the client consumes completely, thereby simulating a message filtering function.
The callback program side executes the self-defined consumption business logic by using the listener, and then replies a target message queue to confirm that the client side has successfully consumed the information.
Further, when sending the message, the sending content is packaged into a uniform message object, the message sender created by the interface instance after serialization executes the sending method to send the message to the target message queue indicated by the destination object, and the message is delivered to the consumer client monitoring the queue by the corresponding target message queue.
In the above described embodiments of the invention all components are located as one part in one program unit, through the general interface as entry point for creating the consumer/sender. Therefore, the purpose of loading the scheme of the embodiment through the SPI mechanism is achieved.
The system for interfacing the message queue based on the standardized message queue operation interface provided by the embodiment can integrate any message queue in a program and meet compatibility by interfacing the service code with only one interface. Therefore, the message queue can be used quickly and efficiently or switched based on the existing code, so that the usability and the software development efficiency are improved, and the maintenance cost is reduced.
Example 2
The embodiment provides a switching system of a message queue, which includes: the device comprises an instance acquisition module, an interface instance calling module, an object generation module and a message receiving and transmitting module.
The instance acquisition module is used for acquiring interface instances of the message queues, and each interface instance corresponds to one type of message queue; the interface instance calling module is used for calling the interface instance corresponding to the target message queue when the current message queue needs to be switched to the target message queue.
Wherein each interface instance corresponds to one type of message queue.
Wherein the driver is obtained using a driver manager. And in the case of initial loading of the DriverManager, triggering initialization logic, scanning out all interface instances contained in the program runtime by using an SPI interface ServiceLoader provided by JDK, and storing all the interface instances into a mapping relation table capable of finding specific interface instances by instance names.
In this embodiment, when the system is just started, the default interface instance configured by the current system may be obtained by the obtaining method provided by the drive manager, or the specified interface instance may be obtained by the name of the specified interface instance.
The object generation module is used for generating corresponding message senders and message consumers through the interface instances.
The present embodiment may further include an information configuration module, configured to configure connection information, where the connection information includes the number of threads, a message mode (such as a contention consumption mode, a sharing consumption mode, and the like), a message filtering policy, and the like.
The message receiving and sending module is used for sending messages to the target message queue through the message sender, and the message consumer subscribes to the messages in the target message queue.
When the type of the target message queue corresponding to the interface instance is ActiveMQ, additional supplementary logic is needed by a creation consumer. The reason is that due to the nature of ActiveMQ itself, i.e., not supporting competitive consumption, one subscription topic only allows one same consumer to connect, and multiple consumers cannot subscribe to the same topic. Therefore, when multiple identical consumer clusters use the same destination object to acquire the same target message queue, the other clients except the connected client start a task thread to connect the ActiveMQ in the background. At this time, one of the clients will consume the message all the time, and when the client goes down, the other clients will complement the message, so as to simulate the competitive consumption mechanism.
In a particular embodiment, the message consumer may further create a listener to listen for the subscribed messages.
Specifically, a message consumer creates a listener, customizes the consumed business logic, and then sets the listener in the consumer and starts the listener.
And when the consumer is started, the message sent by the target message queue is deserialized and is a customized standard message object after the message delivered by the target message queue is received.
In a specific implementation manner, when a target message queue to which a receiving instance is docked is Kafka, because Kafka does not support message filtering, after a corresponding message filtering policy is specified in the step of configuring connection information, a consumer stores the filtering policy in a program memory, performs matching in the memory when receiving a message, and cancels consumption if the filtering policy is not met, so that Kafka is delivered to other clients for retry again until the client consumes completely, thereby simulating a message filtering function.
The callback program side executes the self-defined consumption business logic by using the listener, and then replies a target message queue to confirm that the client side has successfully consumed the information.
Further, when sending the message, the sending content is packaged into a uniform message object, the message sender created by the interface instance after serialization executes the sending method to send the message to the target message queue indicated by the destination object, and the message is delivered to the consumer client monitoring the queue by the corresponding target message queue.
In the above described embodiments of the invention all components are located as one part in one program unit, through the general interface as entry point for creating the consumer/sender. Therefore, the purpose of loading the scheme of the embodiment through the SPI mechanism is achieved.
Example 3
The present embodiment provides an electronic device, which may be represented in the form of a computing device (for example, may be a server device), and includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the message queue switching method in embodiment 1.
Fig. 5 shows a schematic diagram of a hardware structure of the present embodiment, and as shown in fig. 5, the electronic device 9 specifically includes:
at least one processor 91, at least one memory 92, and a bus 93 for connecting the various system components (including the processor 91 and the memory 92), wherein:
the bus 93 includes a data bus, an address bus, and a control bus.
Memory 92 includes volatile memory, such as Random Access Memory (RAM)921 and/or cache memory 922, and can further include Read Only Memory (ROM) 923.
Memory 92 also includes a program/utility 925 having a set (at least one) of program modules 924, such program modules 924 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
The processor 91 executes various functional applications and data processing, such as a message queue switching method in embodiment 1 of the present invention, by running the computer program stored in the memory 92.
The electronic device 9 may further communicate with one or more external devices 94 (e.g., a keyboard, a pointing device, etc.). Such communication may be through an input/output (I/O) interface 95. Also, the electronic device 9 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 96. The network adapter 96 communicates with the other modules of the electronic device 9 via the bus 93. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 9, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems, etc.
It should be noted that although in the above detailed description several units/modules or sub-units/modules of the electronic device are mentioned, such a division is merely exemplary and not mandatory. Indeed, the features and functionality of two or more of the units/modules described above may be embodied in one unit/module, according to embodiments of the application. Conversely, the features and functions of one unit/module described above may be further divided into embodiments by a plurality of units/modules.
Example 4
The present embodiment provides a computer-readable storage medium on which a computer program is stored, which when executed by a processor implements the message queue switching method of embodiment 1.
More specific examples, among others, that the readable storage medium may employ may include, but are not limited to: a portable disk, a hard disk, random access memory, read only memory, erasable programmable read only memory, optical storage device, magnetic storage device, or any suitable combination of the foregoing.
In a possible implementation manner, the present invention can also be implemented in the form of a program product, which includes program code for causing a terminal device to execute a method for implementing the message queue switching method in embodiment 1 when the program product runs on the terminal device.
Where program code for carrying out the invention is written in any combination of one or more programming languages, the program code may be executed entirely on the user device, partly on the user device, as a stand-alone software package, partly on the user device and partly on a remote device or entirely on the remote device.
While specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that this is by way of example only, and that the scope of the invention is defined by the appended claims. Various changes and modifications to these embodiments may be made by those skilled in the art without departing from the spirit and scope of the invention, and these changes and modifications are within the scope of the invention.

Claims (10)

1. A message queue switching method is characterized in that the switching method comprises the following steps:
acquiring interface instances of a message queue, wherein each interface instance corresponds to one type of message queue;
when the current message queue needs to be switched to a target message queue, calling an interface instance corresponding to the target message queue;
the interface instance generates a corresponding message sender and a message consumer;
and the message sender sends the message to the target message queue, and the message consumer subscribes to the message in the target message queue.
2. The method for switching message queues according to claim 1, wherein the step of subscribing the message consumer to the message in the target message queue further comprises the steps of:
the message consumer creates a listener to listen for subscribed messages.
3. The method for switching message queues according to claim 1, wherein the step of generating corresponding message senders and message consumers by the interface instance further comprises the following steps:
creating a destination object;
the message sender sends a message to the target message queue, and the step of subscribing the message in the target message queue by the message consumer specifically comprises:
and the message sender sends a message to the target message queue referred by the destination object, and the consumer subscribes to the message in the target message queue referred by the destination object.
4. The method for switching message queues according to claim 1, wherein the step of generating corresponding message senders and message consumers by the interface instance further comprises the following steps:
and configuring connection information, wherein the connection information comprises the number of threads.
5. The message queue switching method according to claim 4, wherein the connection information further includes a message mode, the message mode including a contention consumption mode and/or a shared consumption mode; and/or the presence of a gas in the gas,
the connection information further includes a message filtering policy.
6. The message queue switching method according to claim 5, wherein when the type of the target message queue is ActiveMQ and there are a plurality of consumers subscribing to the target message queue, the message pattern specifically comprises the competitive consumption pattern to simulate a competitive consumption mechanism.
7. The message queue switching method according to claim 5, wherein when the type of the target message queue is Kafka, the connection information specifically includes the filtering policy to simulate a function of message filtering.
8. A message queue switching system, the switching system comprising: the system comprises an instance acquisition module, an interface instance calling module, an object generation module and a message transceiving module;
the instance acquisition module is used for acquiring interface instances of the message queues, and each interface instance corresponds to one type of message queue;
the interface instance calling module is used for calling an interface instance corresponding to a target message queue when the current message queue needs to be switched to the target message queue;
the object generation module is used for generating corresponding message senders and message consumers through the interface instances;
the message receiving and sending module is used for sending messages to the target message queue through the message sender, and the message consumer subscribes to the messages in the target message queue.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the message queue switching method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the message queue switching method according to any one of claims 1 to 7.
CN202110725263.9A 2021-06-29 2021-06-29 Switching method and switching system of message queue, electronic equipment and storage medium Pending CN113626211A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110725263.9A CN113626211A (en) 2021-06-29 2021-06-29 Switching method and switching system of message queue, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110725263.9A CN113626211A (en) 2021-06-29 2021-06-29 Switching method and switching system of message queue, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113626211A true CN113626211A (en) 2021-11-09

Family

ID=78378495

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110725263.9A Pending CN113626211A (en) 2021-06-29 2021-06-29 Switching method and switching system of message queue, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113626211A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114265638A (en) * 2021-12-24 2022-04-01 北京天融信网络安全技术有限公司 Communication method, device, equipment and storage medium based on plug-in compatibility
CN114513504A (en) * 2022-04-06 2022-05-17 广联达科技股份有限公司 Message queue multi-cloud adaptation method, device and equipment and readable storage medium
CN114710311A (en) * 2022-02-11 2022-07-05 浙江高信技术股份有限公司 Multi-project message management method and system
CN114979178A (en) * 2022-05-12 2022-08-30 中国人民解放军陆军装甲兵学院 Message flow direction control platform and method based on message queue

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030182464A1 (en) * 2002-02-15 2003-09-25 Hamilton Thomas E. Management of message queues
CN103501237A (en) * 2013-09-03 2014-01-08 小米科技有限责任公司 Device management method, management platform, device and system
CN107395729A (en) * 2017-07-27 2017-11-24 深圳乐信软件技术有限公司 A kind of consumption system of message queue, method and device
CN112235205A (en) * 2020-09-21 2021-01-15 珠海市卓轩科技有限公司 Method, device and storage medium for transmitting and consuming MQ message
CN112559208A (en) * 2020-12-15 2021-03-26 浪潮云信息技术股份公司 Method for constructing micro-service MQ applied to government affair cloud platform
WO2021088641A1 (en) * 2019-11-07 2021-05-14 中兴通讯股份有限公司 Data transmission method, data processing method, data reception method and device, and storage medium
CN112988423A (en) * 2021-03-19 2021-06-18 北京京东拓先科技有限公司 Message consumption and message distribution method, device, server and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030182464A1 (en) * 2002-02-15 2003-09-25 Hamilton Thomas E. Management of message queues
CN103501237A (en) * 2013-09-03 2014-01-08 小米科技有限责任公司 Device management method, management platform, device and system
CN107395729A (en) * 2017-07-27 2017-11-24 深圳乐信软件技术有限公司 A kind of consumption system of message queue, method and device
WO2021088641A1 (en) * 2019-11-07 2021-05-14 中兴通讯股份有限公司 Data transmission method, data processing method, data reception method and device, and storage medium
CN112235205A (en) * 2020-09-21 2021-01-15 珠海市卓轩科技有限公司 Method, device and storage medium for transmitting and consuming MQ message
CN112559208A (en) * 2020-12-15 2021-03-26 浪潮云信息技术股份公司 Method for constructing micro-service MQ applied to government affair cloud platform
CN112988423A (en) * 2021-03-19 2021-06-18 北京京东拓先科技有限公司 Message consumption and message distribution method, device, server and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
富亚军作,: "《企业互联网架构原理与实践》", 机械工业出版社, pages: 101 *
昂鑫,: ""基于日志模式发现的系统故障预测"", 《中国优秀硕士学位论文全文数据库 (信息科技辑)》, no. 06, pages 5 *
阳王东等,: ""一种基于消息总线的交通信息集成模型"", 《计算机工程》, vol. 36, no. 14, pages 278 - 280 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114265638A (en) * 2021-12-24 2022-04-01 北京天融信网络安全技术有限公司 Communication method, device, equipment and storage medium based on plug-in compatibility
CN114265638B (en) * 2021-12-24 2024-01-23 北京天融信网络安全技术有限公司 Communication method, device, equipment and storage medium based on plug-in compatibility
CN114710311A (en) * 2022-02-11 2022-07-05 浙江高信技术股份有限公司 Multi-project message management method and system
CN114710311B (en) * 2022-02-11 2024-01-02 浙江高信技术股份有限公司 Multi-project message management method and system
CN114513504A (en) * 2022-04-06 2022-05-17 广联达科技股份有限公司 Message queue multi-cloud adaptation method, device and equipment and readable storage medium
CN114979178A (en) * 2022-05-12 2022-08-30 中国人民解放军陆军装甲兵学院 Message flow direction control platform and method based on message queue
CN114979178B (en) * 2022-05-12 2023-11-10 中国人民解放军陆军装甲兵学院 Message flow control platform and method based on message queue

Similar Documents

Publication Publication Date Title
CN113626211A (en) Switching method and switching system of message queue, electronic equipment and storage medium
CN108449410B (en) Message management method, system and related device in cloud platform
CN111782370B (en) Kubernetes multi-cluster management system, method, terminal and storage medium
US20080222617A1 (en) Server side application integration framework
US20080140759A1 (en) Dynamic service-oriented architecture system configuration and proxy object generation server architecture and methods
US20080140857A1 (en) Service-oriented architecture and methods for direct invocation of services utilizing a service requestor invocation framework
US20030061323A1 (en) Hierarchical system and method for centralized management of thin clients
US20020062334A1 (en) Dynamic agents for dynamic service provision
CN113742031B (en) Node state information acquisition method and device, electronic equipment and readable storage medium
CN111930525B (en) GPU resource use method, electronic device and computer readable medium
CN112527520A (en) Method and device for deploying message middleware
WO2021159831A1 (en) Programming platform user code running method, platform, node, device and medium
CN111858007A (en) Task scheduling method and device based on message middleware
CN111045807A (en) Zookeeper task processing method and device, computer equipment and storage medium
CN112230987A (en) System and method for realizing distributed modular plug-in framework
CN112559461A (en) File transmission method and device, storage medium and electronic equipment
CN116389552A (en) Heterogeneous data transmission system based on publish-subscribe model
CN113971098A (en) RabbitMQ consumption management method and system
US20100023950A1 (en) Workflow processing apparatus
CN113626095A (en) Switching method and switching system of configuration center, electronic equipment and storage medium
CN111240760B (en) Application publishing method, system, storage medium and equipment based on registry
US20100122261A1 (en) Application level placement scheduler in a multiprocessor computing environment
EP3721604B1 (en) Automatic subscription management of computing services
US20100250684A1 (en) High availability method and apparatus for shared resources
CN115543574A (en) Task scheduling method and system applied to video digital collection generation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination