CN113254235A - Message transmission method and device under multi-test environment - Google Patents

Message transmission method and device under multi-test environment Download PDF

Info

Publication number
CN113254235A
CN113254235A CN202110636928.9A CN202110636928A CN113254235A CN 113254235 A CN113254235 A CN 113254235A CN 202110636928 A CN202110636928 A CN 202110636928A CN 113254235 A CN113254235 A CN 113254235A
Authority
CN
China
Prior art keywords
message
recipient
test environment
destination
sender
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
CN202110636928.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.)
Xingyin Information Technology Wuhan Co ltd
Original Assignee
Xingyin Information Technology Wuhan 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 Xingyin Information Technology Wuhan Co ltd filed Critical Xingyin Information Technology Wuhan Co ltd
Priority to CN202110636928.9A priority Critical patent/CN113254235A/en
Publication of CN113254235A publication Critical patent/CN113254235A/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
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application relates to the technical field of computers, and discloses a message transmission method under a multi-test environment, wherein the multi-test environment comprises a first test environment and a second test environment, the first test environment and the second test environment comprise at least one sender and at least one receiver, a message is forwarded between the sender and the receiver through a message middleware, the sender sends the message, and the message comprises a first mark used for indicating the sender; the message middleware receives the message and determines a receiver as a message destination from receivers connected with the message middleware according to the first mark; the recipient as a destination gets the message via the message middleware. This application makes every developer or tester all can realize the concurrent test of multi-service on the test environment of oneself, very big improvement the efficiency of test, satisfies developer and tester's demand conscientiously, convenient and fast high efficiency.

Description

Message transmission method and device under multi-test environment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for message delivery in a multi-test environment.
Background
There are many microservices in a system and the implementation of a system requires multiple development teams to complete together. When a development team develops a microservice, it is necessary to load a newly designed microservice (i.e., adjust only some of the microservices) in a test environment and test the developed microservice to determine whether it is functioning properly. Only one developer or tester can test at a time. Often, the number of deployed test environments is limited, and after a test environment is occupied by a certain developer, other testers need to queue up to use the test environment. This results in a large amount of waiting time, which results in wasted time and low efficiency, and if the operation is improper, data between different test items may interfere with each other, thereby affecting the test result.
Disclosure of Invention
The embodiment of the application provides a message transmission method, a message transmission device, message transmission equipment and a message transmission medium in a multi-test environment.
In a first aspect, an embodiment of the present application provides a message passing method in a multi-test environment, for an electronic device, where the multi-test environment includes a first test environment and a second test environment, where the first test environment and the second test environment include at least one sender and at least one receiver, and a message is forwarded between the sender and the receiver through message middleware, where the method includes:
the sender sending the message, wherein the message comprises a first flag to indicate the sender;
the message middleware receives the message and determines a receiver as a message destination from the receivers connected with the message middleware according to the first mark;
the recipient as a destination gets the message via the message middleware.
In a possible implementation of the first aspect, the message is a first message sent by a first sender of the first test environment, and the first message is obtained by a first receiver of the first test environment.
In a possible implementation of the first aspect, the message is a second message sent by a second sender of the second test environment, and the second message is received by the first recipient in the first test environment or a second recipient in the second test environment based on control of the message middleware.
In a possible implementation of the first aspect, the second sender of the second test environment sends the second message, and the second message is acquired by the second recipient when the message middleware detects the second recipient as a message destination in the second test environment.
In a possible implementation of the first aspect, the second sender of the second test environment sends the second message, and the second message is obtained by a third recipient in the first test environment in a case that the message middleware does not detect the second recipient as a message destination in the second test environment.
In a possible implementation of the first aspect, determining a recipient as a message destination from the recipients connected to the message middleware according to the first flag in the message includes: the message middleware determines a recipient as a message destination by matching a second tag included in the recipient with the first tag.
In one possible implementation of the first aspect, the message middleware determines a recipient as a message destination by matching a second tag included in the recipient with the first tag, including: in a case where the second flag of the recipient is the same as the first flag, the message middleware determines the recipient as the message destination.
In one possible implementation of the first aspect, the message middleware determines a recipient as a message destination by matching a second tag included in the recipient with the first tag, including: the message middleware determines the receiver as the message destination in case that a conversion rule based on a preset is satisfied between the second flag and the first flag.
In one possible implementation of the first aspect, after determining a destination of a message, the message middleware forwards the message to the recipient as the message destination.
In one possible implementation of the first aspect, after determining a destination of a message, the recipient as the destination queries and retrieves the message from the message middleware based on the second tag.
In a possible implementation of the first aspect, the first flag and the second flag are added in a header of the message.
In a possible implementation of the first aspect, the first flag and the second flag are marked by the message middleware modification switch and message queue name.
In a possible implementation of the first aspect, after the second message is obtained by a third recipient in the first test environment, when the message middleware detects a second recipient as a message destination in the second test environment, the second message is obtained by the second recipient again and is processed in an idempotent manner.
In a second aspect, an embodiment of the present application provides a message passing method in a multi-test environment, for an electronic device, where the multi-test environment includes a first test environment and a second test environment, where the first test environment and the second test environment include at least one sender and at least one receiver, and where the message is forwarded between the sender and the receiver through message middleware, the apparatus includes:
a sending module that the sender sends the message, wherein the message includes a first flag to indicate the sender;
a delivery module that receives the message and determines a recipient as a message destination from among the recipients connected to the message middleware according to the first tag;
a receiving module for a recipient as a destination to get the message via the message middleware.
In a possible implementation of the second aspect, the message is a first message sent by a first sender of the first test environment, and the first message is obtained by a first recipient of the first test environment.
In a possible implementation of the second aspect described above, the message is a second message sent by a second sender of the second test environment, and the second message is received by the first recipient in the first test environment or a second recipient in the second test environment based on control of the message middleware.
In a possible implementation of the second aspect, the second sender of the second test environment sends the second message, and the second message is acquired by the second recipient in a case where the message middleware detects the second recipient as a message destination in the second test environment.
In a possible implementation of the second aspect, the second sender of the second test environment sends the second message, and the second message is acquired by a third recipient in the first test environment in a case where the message middleware does not detect the second recipient as a message destination in the second test environment.
In one possible implementation of the second aspect, determining a recipient as a message destination from the recipients connected to the message middleware according to the first flag in the message includes: the message middleware determines a recipient as a message destination by matching a second tag included in the recipient with the first tag.
In one possible implementation of the second aspect, the message middleware determines a recipient as a message destination by matching a second tag included in the recipient with the first tag, including: in a case where the second flag of the recipient is the same as the first flag, the message middleware determines the recipient as the message destination.
In one possible implementation of the second aspect, the message middleware determines a recipient as a message destination by matching a second tag included in the recipient with the first tag, including: the message middleware determines the receiver as the message destination in case that a conversion rule based on a preset is satisfied between the second flag and the first flag.
In one possible implementation of the second aspect described above, after determining a destination of a message, the message middleware forwards the message to the recipient as the message destination.
In one possible implementation of the second aspect described above, after determining the destination of the message, the recipient as the destination queries and retrieves the message from the message middleware based on the second tag.
In a possible implementation of the second aspect described above, the first flag and the second flag are added in a header of the message.
In a possible implementation of the second aspect described above, the first and second flags are marked by the message middleware modification switch and message queue names.
In a possible implementation of the second aspect, after the second message is obtained by a third recipient in the first test environment, when the message middleware detects a second recipient as a message destination in the second test environment, the second message is obtained by the second recipient again and is processed in an idempotent manner.
In a third aspect, an embodiment of the present application provides a message passing apparatus in a multi-test environment, where the message passing apparatus in the multi-test environment includes:
a memory for storing instructions for execution by one or more processors of the system, an
The processor, being one of the processors of the system, is configured to execute the instructions to implement any one of the possible methods of the first aspect described above.
In a fourth aspect, the present application provides a computer-readable medium, on which instructions are stored, and when executed on a computer, the instructions may cause the computer to perform any one of the possible methods of the first aspect.
Compared with the prior art, the application has the following effects:
in the prior art, only one developer or tester can do all asynchronous tests, which greatly affects the working efficiency. The message transmission method under the multi-test environment disclosed by the application enables each developer or tester to realize multi-service simultaneous test in the own test environment, greatly improves the test efficiency, practically meets the requirements of the developers and the testers, meanwhile, the method only takes effect in the test environment, has no influence on the online environment, is controllable in risk, is transparent to users, does not need to modify any service code, can be started only by upgrading the version of the middleware, is convenient, rapid and efficient, and has good integration with a distributed remote calling framework.
Drawings
FIG. 1 illustrates an application scenario diagram of a messaging method in a multi-test environment, according to some embodiments of the present application;
FIG. 2 illustrates a block diagram of a hardware architecture of a message passing method in a multi-test environment, according to some embodiments of the present application;
FIG. 3 illustrates a schematic diagram of a messaging method in a multi-test environment, according to some embodiments of the present application;
FIG. 4 illustrates a flow diagram of a method of message delivery in a multi-test environment, according to some embodiments of the present application;
FIG. 5 illustrates a scenario of a message delivery method in three different test procedures, according to some embodiments of the present application;
fig. 6 illustrates a schematic diagram of tagging in a message middleware RabbitMQ, according to some embodiments of the present application;
FIG. 7 illustrates a block diagram of a messaging appliance in a multi-test environment, according to some embodiments of the present application.
Detailed Description
Illustrative embodiments of the present application include, but are not limited to, a method, apparatus, device, and medium for message passing in a multi-test environment.
It is to be appreciated that the messaging methods provided herein in a multi-test environment can be implemented on a variety of electronic devices including, but not limited to, a server, a distributed server cluster of multiple servers, a cell phone, a tablet, a laptop, a desktop computer, a wearable device, a head-mounted display, a mobile email device, a portable game console, a portable music player, a reader device, a personal digital assistant, a virtual reality or augmented reality device, a television set or other electronic device having one or more processors embedded or coupled therein, and the like.
It is to be appreciated that in various embodiments of the present application, the processor may be a microprocessor, a digital signal processor, a microcontroller, or the like, and/or any combination thereof. According to another aspect, the processor may be a single-core processor, a multi-core processor, the like, and/or any combination thereof.
Embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
FIG. 1 illustrates a scenario diagram of message delivery in a multi-test environment, according to some embodiments of the present application. Specifically, as shown in fig. 1, the message passing method in the multi-test environment is applied to a message passing system in the multi-test environment. The messaging system in the multi-test environment includes a terminal 110, a server 120, and a terminal 130. The terminals 110, the server 120 and the terminals 130 are connected via a network, which may include various connection types such as a wired line, a wireless communication link, a cloud or a fiber optic cable, and the like, and the specific examples of the network described above may include the internet provided by the communication providers of the terminals 110 and 130. Other connections between terminal 110 and terminal 130 are possible, such as a data line connection, so that the received audio can be transmitted to terminal 110.
The terminal 110 and the terminal 130 may be devices installed with messaging software in an end-to-end multi-test environment, and may specifically be desktop terminals or mobile terminals, and the mobile terminals may be, but are not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices.
The server 120 may be implemented as a stand-alone server or a server cluster composed of a plurality of servers.
First, a test environment is deployed on both terminal 110 and terminal 130. A user, such as a developer or a tester, may test multiple services simultaneously on the terminal 110 and/or the terminal 130 based on a message passing method in a multi-test environment, and separate the tests from each other through asynchronous message passing to maintain stability of data. The terminal 110 and/or the terminal 130 transmit the test requirement information to the server 120. The server 120 calls and configures the physical resources required by the test environment according to the test resource requirement information.
As an example, only 2 terminals are shown here, but the present application is not limited thereto, and a plurality of test environments may be built on one terminal device or a plurality of test environments may be built on a plurality of terminals.
The following describes in detail a message passing scheme applied to the scenario shown in fig. 1 in a multi-test environment according to some embodiments of the present application. The multi-test environment includes a common test environment (as an example of a first test environment) and a personal test environment (as an example of a second test environment), wherein the test environments may be deployed on the terminal 110 and/or the terminal 130, and the server 120 invokes and configures physical resources required by the test environments according to test requirements on the terminal 110 and/or the terminal 130. At least one sender and at least one receiver are included in the first test environment and the second test environment, and messages are forwarded between the sender and the receiver through the message middleware. Firstly, a sender sends a message comprising a first mark for indicating the sender, then, a message middleware receives the message, determines a receiver as a message destination from receivers connected with the message according to the first mark in the message, and then, the receiver as the destination obtains the message through the message middleware to finish message transmission in a multi-test environment. According to the technical scheme, the receiver can receive the test message sent by the sender in the same test environment by adding the mark on the message, so that the isolation of service calling among different test environments in the asynchronous environment of the message queue is realized, and the tests can be synchronously carried out without interference.
While the method embodiments provided in this application may be executed in the terminal 110 and/or the terminal 130, fig. 2 illustrates a hardware block diagram of a message passing method in a multi-test environment according to some embodiments of the present application. As shown in fig. 2, terminal 110 (which is also applicable to terminal 130) may include one or more (only one shown) processors 111 (processor 111 may include, but is not limited to, a processing device such as a central processing unit CPU, an image processor GPU, a digital signal processor DSP, a microprocessor MCU, or a programmable logic device FPGA), an input-output interface 112 for interacting with a user, a memory 113 for storing data, and a transmission device 114 for communication functions. It will be understood by those skilled in the art that the structure shown in fig. 2 is only an illustration and is not intended to limit the structure of the electronic device. For example, terminal 110 may also include more or fewer components than shown in FIG. 2, or have a different configuration than shown in FIG. 2.
The processor 111 executes various functional applications and data processing by running software programs and modules stored in the memory 113, that is, implements the message passing method in the multi-test environment described above.
The input/output interface 112 may be connected to one or more displays, touch screens, etc. for displaying data transmitted from the terminal 110, and may also be connected to a keyboard, a stylus, a touch pad, and/or a mouse, etc. for inputting user instructions such as selection, creation, editing, etc.
The memory 113 may be used to store databases, queues, software programs and modules for application software, such as program instructions/modules corresponding to message passing methods in a multi-test environment in some embodiments of the present application. The memory 113 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 113 may further include memory located remotely from processor 111, which may be connected to terminal 110 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 114 is used to receive data transmitted by the server 120 to the server 120 via a network, which may include various connection types, such as wired, wireless communication links, cloud or fiber optic cables, and so on. Specific examples of the network described above may include the internet provided by the communication provider of the terminal 110.
In some embodiments, there is only one public environment (which is an instance of the first test environment), and the services on the public environment are relatively stable versions and should include all required services; the personal environment (which is an example of the second testing environment) may be multiple, and when different services are tested, a personal environment may be established, and each developer may have its own personal environment, and its own personal environment generally includes only its own responsible service. For a developer, if only the sender needs to be tested, only the sender may be deployed in the testing environment, and if the receiver needs to be tested, both the sender and the receiver need to be deployed in the testing environment.
According to one embodiment of the application, both the public environment and the personal environment communicate over a RockettMQ (which is an instance of message middleware) involved in the messaging process of the RockettMQ, five roles are sender (producer), recipient (consumer), message server (broker), topic (topic), and queue (queue), respectively. The sender is used for producing and sending messages, and the senders which produce and send the same messages aiming at the same service are combined together to obtain a sender Group (Producer Group); the receiver is used for obtaining the same message sent by the sender through the RocktMQ, supporting to receive the message in a push mode and a pull mode, and combining the receivers receiving the message sending the coupon together to obtain a receiver Group (Consumer Group); the message server is mainly responsible for storing, delivering and inquiring messages and ensuring high availability of services; the subject is a logical concept, which is composed of a plurality of queues and represents a class of messages, such as coupon messages, logistics messages, payment messages and the like in order service; the queue is one of the designated parts of the fragments on a message server, and is a basic unit for resource allocation in the load balancing process. A theme is composed of a plurality of queues, the queues are evenly distributed on a plurality of message servers, and a plurality of themes can be configured on one message server. In some embodiments, when a developer needs to test the coupon service of one of the sub-services in the order service, the sender produces and sends a coupon message to the same topic on the message server, and the recipient pulls the coupon message from the same topic on the message server and consumes.
FIG. 3 shows a schematic diagram of message passing in a multi-test environment. As shown in fig. 3, the multi-test environment includes a public environment in which there is a sender 1, and a receiver 1 and a receiver 2, and a personal environment in which there is a sender 2, a sender 3, and a receiver 3. It is assumed that all senders and recipients are connected to the same topic of the rockmq, and that the same topic may be stored in different queues of different message servers.
Sender 1 sends message 1 with tag 1 to topic of the message middleware; the RocketMQ receives message 1 when it finds recipient 1, which can be the destination recipient, through tag 1 in message 1; recipient 1 receives message 1 from sender 1.
Sender 2 sends message 2 with tag 2 to the subject, and when the rockmq does not find its corresponding recipient from the recipients, the rockmq forwards the message 2 to the recipients of the public environment, for receipt by recipient 1 and recipient 2 in the public environment.
Sender 3 sends message 3 with tag 3 to the subject, and when the rockmq finds recipient 3 in the personal environment, which can be the destination recipient, recipient 3 receives message 3 from sender 3.
Through the message transmission mode in the application, the message sent in the personal environment can be received by the receiver in the same personal environment, meanwhile, the service code does not need to be changed, and the service call isolation between different test environments is completed under the condition of asynchronous message transmission.
FIG. 4 illustrates a flow diagram of a method of message delivery in a multi-test environment, according to some embodiments of the present application.
As shown in fig. 4, in some embodiments, the method may include:
step 401: the sender sends a message with a first tag.
Specifically, in step 401, in some embodiments, the first flag or the second flag is implemented by using a header of the message plus a lane flag, for example, adding an environment variable in a key _ value mode in the header of the message, where key is fixed, and env is an external command, and all environment variables and their assignments can be listed through a program file/bin/env. value can be customized within the range of no more than 20 bytes, for example, fayouhuiquan, which means that the test environment is created to test the sub-service for sending coupons in the order service, and users can also customize according to their own preferences in order to view the Pinyin spelling definition of the sub-service. In some embodiments, when a developer needs to test the coupon service of one of the sub-services in the order service, the sender sends a message with a header labeled fayouhuiquan to the subject of the message middleware.
Step 402: the message middleware receives the message and determines a recipient as a destination according to the first flag.
Specifically, in step 402, the rockmq receives the coupon message and determines the recipient to which the message is destined from the recipients connected to the rockmq based on whether the second indicia of the recipient matches the fayouhouquan indicia. Further, the second mark is considered to match the first mark when either of the following conditions is met: when the second label of the recipient is the same as the first label, i.e., the second label is also an environmental variable of fayouhuiquan; when a conversion rule based on a preset is satisfied between the second tag and the first tag, for example, when the sender sends a message with the first tag fayouhuanan, the second tag of the receiver is fayouhuanan-1, that is, when a preset conversion rule of the second tag being the first tag plus a suffix, for example "-1", is satisfied, the second tag is considered to match the first tag. For another example, a regular match, specifically a match between a second mark defined by a regular definition and a first mark, is determined when the first mark and the second mark can be transformed. The above is merely an exemplary illustration, and any way of satisfying the preset conversion rule may be used as a condition for matching the second mark with the first mark.
Step 403: the recipient as a destination gets the message via the message middleware.
Specifically, in step 403, after the rockmq determines the recipient as the destination of the message, in some embodiments, the message with the token of fayouhuanan is forwarded to the recipient as the destination of the message, i.e., the recipient is pushed with the message with the token of fayouhuanan. In some embodiments, the recipient may determine the message that matches the token fayouhuanan in a manner that queries from the rockmq whether it matches the second token it has, and then retrieves the message with the token fayouhuanan from the rockmq, i.e., the recipient actively pulls the message with the token fayouhuanan.
In the prior art, if the message is not marked, the message generated by the coupon service is sent to all the receivers of the sub-services in the order service, including the receivers of the order placing service, the short message service, the coupon service, the payment service and the like, so that the whole system is complicated and disordered, the service efficiency is reduced, the halt can be caused more seriously, once the service is on-line, the user can not be fed back in time, and the user experience is reduced seriously. Through the technical scheme in the application, message transmission under a multi-test environment is realized, so that the non-interfering isolation test of the sub-services can be completed, and the test efficiency is greatly improved. And updating the test to a public environment after the test is stable, and carrying out the next examination and approval online process.
In the sub-service test, there are many situations, and the following describes different message passing situations in the test process with reference to fig. 5.
FIG. 5 illustrates a scenario of message delivery during three different tests, according to some embodiments of the present application. Fig. 5a shows a situation where the recipient is present only in the personal environment. As shown in fig. 5a, for a sub-service coupon issuing service of an order service, a developer develops a new function of issuing a coupon to a user after an order is completed, at this time, a function of not issuing a coupon in the original order service corresponds to a multi-test environment, that is, there is no receiver corresponding to the coupon issuing service in a public environment, and thus there is only a receiver capable of receiving and issuing a coupon message in a personal environment of the developer. At this point, the developer creates a recipient for the coupon campaign when the personal environment is established.
When a sender sends a message with a fayouhuanan tag, a RockettMQ as the message middleware receives the message and queries the recipient connected to it, finds a second tag, fayouhuanan-1, of the recipient in the same personal environment as the sender, determines a match with the fayouhuanan tag, and thus determines that the recipient is the intended recipient. Next, the recipient as the destination acquires the message with the fayouhuiquan mark, completes the transmission of the message once, and then completes the test. When the service is stabilized and approved, it can be stabilized into a public environment and the coupon-issuing sub-service, which becomes an online order service, is placed into service.
Fig. 5b shows a situation where the recipient is present only in the public environment. As shown in fig. 5b, for the sub-service coupon service of the order service, there is already a stable test environment for issuing a coupon full of 200 minus 10 to the customer after the order is completed in the public environment. However, due to the requirements of activities such as 618, double 11, etc., developers need to issue coupons that are 200 minus 15 full to users after the order is completed, i.e., only changes are made to the specific amount of coupons issued, but the categories are unchanged. At this time, the original order service has a function of sending the coupon, and the function of sending the coupon meets new requirements through parameter adjustment.
A new coupon service may be implemented in correspondence to the multi-test environment, i.e., the existing recipients corresponding to the coupon service in the public environment. Therefore, when the developer establishes the personal environment, the developer corresponds the receiver corresponding to the coupon service existing in the public environment to the sender, when the sender sends the message marked with the fayouhuiquan200-15, the RockettMQ receives the message and queries the receiver connected with the RockueMQ, the second mark of the receiver corresponding to the coupon service existing in the public environment is fayouhuiquan-1 and is matched with the fayouhuiquan200-15, and therefore the receiver acquires the message marked with the fayouhuiquan200-15 for the receiver as the destination, and the message delivery is completed without newly establishing a receiver, and the test is completed.
Fig. 5c shows the situation where the recipient is present in both the public environment and the personal environment. As shown in fig. 5c, for the sub-service coupon service of the order service, there is a coupon that is filled 200 minus 10 to the customer after the order is completed already in the public environment. However, due to the requirements of activities such as 618, double 11, etc., developers need to send the user three and seven-fold coupons after the order is completed, i.e., changes are made to the type of coupon being sent. At this time, the existing coupon issuing function in the original order service can only be fully reduced, and a new type of coupon issuing mode of fully three and seven folds cannot be satisfied. The corresponding to the multi-test environment, i.e. the existing receivers corresponding to the coupon service in the public environment, cannot realize the new coupon service. At this time, the developer needs to create a new recipient corresponding to the coupon issue at the time of personal environment establishment, and when the sender sends a message labeled with fayouhuiquan3-7, the rockmq receives the message and queries the recipients connected to the rockmq, finds that the second label of the recipient in the same personal environment as the sender is fayouhuiquan3-7, and matches the fayouhuiquan3-7 label, so that the recipient acquires the message labeled with fayouhuiquan3-7 for the recipient as the destination, completes the message delivery once, and then completes the test. And when the service is stable and approved, it can be added to the coupon-issuing sub-service in the public environment and the coupon-issuing sub-service that updates the on-line order service is put into service.
In some embodiments, the message middleware RocktMQ preferably checks whether there is a matching recipient in the same personal environment as the sender, and if so, preferably passes the message to that recipient, and if not, passes the message to a recipient in the public environment. And after the message is delivered to the receiver in the public environment, and a matched receiver in the same personal environment as the sender is detected, the message is delivered to the matched receiver in the same personal environment as the sender again, and at the moment, the message which is received in the public environment can be received by the receiver according to the configuration, so that the service party is required to do idempotent processing.
In some embodiments, the first tag and the second tag are tagged by message middleware modification of switch and message queue names.
Fig. 6 illustrates a schematic diagram of tagging in a message middleware RabbitMQ, according to some embodiments of the present application. In the prior art, senders in personal and public environments have sent messages to different queues, thereby segregating the messages. Specifically, for the sub-service coupon issuing service of the order service, when a developer updates a function of issuing a coupon to a user after an order is completed, at this time, there is a function of issuing a coupon in the original order service, and when there are a sender and a receiver in a multi-test environment, that is, there are a sender and a receiver in a personal environment, the sender jiaxu _ producer in the personal environment will default to send a message to an exchanger (personal _ jiaxu _ exch in fig. 6), and the receiver in the personal environment will default to monitor a message sent in the personal environment in a queue personal _ jiaxu _ queue; when a developer develops a new function of issuing a coupon to a user after an order is completed, at this time, when there is no function of issuing a coupon in the original order service, and the function corresponds to a multi-test environment, that is, only a sender and no receiver exist in a personal environment, a sender jiaxu _ producer in the personal environment sends a message to a switch (exchange, abbreviated as "exch" in fig. 6) by default, and forwards the message to another message queue1 through a backup switch (alternate exchange, personal _ jiaxu _ exch1 in fig. 6), and finally the message is received by a receiver connumer 1. When no receiver exists in the personal environment, the message is routed to the public environment, the RabbitMQ serving as the message middleware only performs a transitional transfer function, the message is not filtered at the receiver end, but is directly filtered in the RabbitMQ, the efficiency in the whole message transmission process is improved, and the throughput of the system is enhanced. Thus, when the names of the switch and message queue are marked, messaging on the personal environment can be achieved. Further, for fanout type messages, if there are 3 recipients and only one recipient is established on the personal environment (the other two recipients are on the public environment), then the message will only be consumed by the one recipient on the personal environment. In which case all relevant recipients to fanout are activated on the personal environment.
In some embodiments, the message middleware may be, but is not limited to, RoMQ, RabbitMQ, ActiveMQ, Kafka.
In the prior art, only one developer or tester can do all asynchronous tests, which greatly affects the working efficiency. The message transmission method under the multi-test environment disclosed by the application enables each developer or tester to realize multi-service simultaneous test in the own test environment, greatly improves the test efficiency, practically meets the requirements of the developers and the testers, meanwhile, the method only takes effect in the test environment, has no influence on the online environment, is controllable in risk, is transparent to users, does not need to modify any service code, can be started only by upgrading the version of the middleware, is convenient, rapid and efficient, and has good integration with a distributed remote calling framework.
According to some embodiments of the present application, a messaging device 700 under multiple test environments is provided, and fig. 7 is a schematic structural diagram of a messaging device under multiple test environments according to some embodiments of the present application. As shown in fig. 7, the messaging device 700 in the multi-test environment is as follows:
a sending module 701 sends a message with a first tag.
A delivery module 702, the message middleware receives the message and determines a recipient as a destination based on the first token.
The receiving module 703 obtains the message via the message middleware by the recipient as a destination.
The first embodiment is a method embodiment corresponding to the present embodiment, and the present embodiment can be implemented in cooperation with the first embodiment. The related technical details mentioned in the first embodiment are still valid in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the first embodiment.
A third embodiment of the present application relates to a message passing apparatus in a multi-test environment, including:
a memory for storing instructions for execution by one or more processors of the system, an
The processor, being one of the processors of the system, is configured to execute the instructions to implement any one of the possible methods of the first aspect described above.
The first embodiment is a method embodiment corresponding to the present embodiment, and the present embodiment can be implemented in cooperation with the first embodiment. The related technical details mentioned in the first embodiment are still valid in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the first embodiment.
A fourth embodiment of the present application relates to a computer storage medium encoded with a computer program, the computer readable medium having stored thereon instructions that, when executed on a computer, can cause the computer to perform any one of the possible methods of the first aspect described above.
The first embodiment is a method embodiment corresponding to the present embodiment, and the present embodiment can be implemented in cooperation with the first embodiment. The related technical details mentioned in the first embodiment are still valid in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the first embodiment.
Each method embodiment of the present application may be implemented by software, hardware, firmware, or the like. Whether implemented in software, hardware, or firmware, the instruction code may be stored in any type of computer-accessible memory (e.g., permanent or modifiable, volatile or non-volatile, solid or non-solid, fixed or removable media, etc.). Also, the Memory may be, for example, Programmable array Logic ("PAL"), random access Memory ("RAM"), Programmable Read Only Memory ("PROM"), Read-Only Memory ("ROM"), Electrically Erasable Programmable Read Only Memory ("EEPROM"), magnetic disk, optical disk, Digital Versatile disk ("DVD"), or the like.
It should be noted that, all units/modules mentioned in the device embodiments of the present application are logic units/modules, and physically, a logic unit may be a physical unit, or a part of a physical unit, or may be implemented by a combination of multiple physical units, where the physical implementation manner of the logic unit itself is not the most important, and the combination of the functions implemented by the logic units is the key to solve the technical problem provided by the present application. In addition, in order to highlight the innovative part of the present application, the above-mentioned embodiments of the apparatus of the present application do not introduce elements that are not so closely related to solve the technical problems proposed by the present application, which does not indicate that the above-mentioned embodiments of the apparatus do not include other elements.
It is to be noted that in the claims and the description of the present patent, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the use of the verb "comprise a" to define an element does not exclude the presence of another, same element in a process, method, article, or apparatus that comprises the element.
While the present application has been shown and described with reference to certain preferred embodiments thereof, it will be understood by those of ordinary skill in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present application.

Claims (16)

1. A message passing method in a multi-test environment for an electronic device, wherein the multi-test environment includes a first test environment and a second test environment including at least one sender and at least one receiver therein, the message being forwarded between the sender and the receiver through message middleware,
characterized in that the method comprises:
the sender sending the message, wherein the message comprises a first flag to indicate the sender;
the message middleware receives the message and determines a receiver as a message destination from the receivers connected with the message middleware according to the first mark;
the recipient as the destination gets the message via the message middleware.
2. The method of claim 1,
the message is a first message sent by a first sender of the first test environment, and the first message is retrieved by a first recipient of the first test environment.
3. The method of claim 1,
the message is a second message sent by a second sender of the second test environment, and the second message is received by the first recipient in the first test environment or a second recipient in the second test environment based on control of the message middleware.
4. The method of claim 3, wherein the method comprises:
a second sender of the second test environment sends the second message,
in the event that the message middleware detects a second recipient as a message destination in the second test environment, the second message is retrieved by the second recipient.
5. The method of claim 3, wherein the method comprises:
a second sender of the second test environment sends the second message,
in the event that the message middleware does not detect a second recipient as a message destination in the second test environment, the second message is retrieved by a third recipient in the first test environment.
6. The method of claim 1,
determining a recipient as a message destination from among the recipients connected to the message middleware according to a first flag in the message, including:
the message middleware determines a recipient as a message destination by matching a second tag included in the recipient with the first tag.
7. The method of claim 6, wherein the message middleware determines the recipient as the message destination by matching a second tag included in the recipient with the first tag, comprising:
in a case where the second flag of the recipient is the same as the first flag, the message middleware determines the recipient as the message destination.
8. The method of claim 6, wherein the message middleware determines the recipient as the message destination by matching a second tag included in the recipient with the first tag, comprising:
the message middleware determines the receiver as the message destination in case that a conversion rule based on a preset is satisfied between the second flag and the first flag.
9. The method of claim 1, wherein after determining a destination for a message, the message middleware forwards the message to the recipient as the message destination.
10. The method of claim 1, wherein after determining a destination for a message, the recipient as the destination queries and retrieves the message from the message middleware based on the second token.
11. The method according to any of claims 6-8, wherein the first tag and the second tag are added in a header of the message.
12. The method of any of claims 6-8, wherein the first tag and the second tag are tagged by the message middleware modification switch and message queue name.
13. The method of claim 4, wherein after the second message is retrieved by a third recipient in the first test environment, the message middleware detects a second recipient as a message destination in the second test environment, and the second message is retrieved by the second recipient again and idempotent processed.
14. A messaging appliance in a multi-test environment, wherein the multi-test environment includes a first test environment and a second test environment including at least one sender and at least one recipient in the first test environment and the second test environment, the message being forwarded between the sender and the recipient through message middleware,
characterized in that the device comprises:
a sending module that the sender sends the message, wherein the message includes a first flag to indicate the sender;
a delivery module that receives the message and determines a recipient as a message destination from among the recipients connected to the message middleware according to the first tag;
a receiving module for a recipient as a destination to get the message via the message middleware.
15. A messaging appliance in a multi-test environment, comprising:
a memory for storing instructions for execution by one or more processors of the system, an
A processor, being one of the processors of the system, for executing the instructions to implement the message passing method in a multi-test environment of any one of claims 1-13.
16. A computer-readable storage medium encoded with a computer program, having instructions stored thereon, which, when executed on a computer, cause the computer to perform the method of messaging in a multi-test environment of any of claims 1-13.
CN202110636928.9A 2021-06-08 2021-06-08 Message transmission method and device under multi-test environment Pending CN113254235A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110636928.9A CN113254235A (en) 2021-06-08 2021-06-08 Message transmission method and device under multi-test environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110636928.9A CN113254235A (en) 2021-06-08 2021-06-08 Message transmission method and device under multi-test environment

Publications (1)

Publication Number Publication Date
CN113254235A true CN113254235A (en) 2021-08-13

Family

ID=77186996

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110636928.9A Pending CN113254235A (en) 2021-06-08 2021-06-08 Message transmission method and device under multi-test environment

Country Status (1)

Country Link
CN (1) CN113254235A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113836024A (en) * 2021-09-27 2021-12-24 中南大学 Traffic multiplexing AB test method and system based on configuration drive
CN114884855A (en) * 2022-07-11 2022-08-09 简单汇信息科技(广州)有限公司 Routing method and system under asynchronous communication

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102006309A (en) * 2010-12-16 2011-04-06 新余钢铁集团有限公司 Method for performing real-time communication between manufacturing execution system (MES) and process control system (PCS) and middleware
US8490084B1 (en) * 2009-06-18 2013-07-16 Amazon Technologies, Inc. Installation testing in automated application distribution
CN107590072A (en) * 2017-08-30 2018-01-16 深圳乐信软件技术有限公司 A kind of application and development and the method and apparatus of test
CN110297766A (en) * 2019-06-03 2019-10-01 合肥移瑞通信技术有限公司 Method for testing software and software testing system based on distributed test node cluster
CN110347520A (en) * 2019-06-28 2019-10-18 北京大米科技有限公司 Method, apparatus, electronic equipment and the medium of message distribution
CN111464380A (en) * 2020-03-19 2020-07-28 时时同云科技(成都)有限责任公司 Method, device and system for parallel testing of multiple service items

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8490084B1 (en) * 2009-06-18 2013-07-16 Amazon Technologies, Inc. Installation testing in automated application distribution
CN102006309A (en) * 2010-12-16 2011-04-06 新余钢铁集团有限公司 Method for performing real-time communication between manufacturing execution system (MES) and process control system (PCS) and middleware
CN107590072A (en) * 2017-08-30 2018-01-16 深圳乐信软件技术有限公司 A kind of application and development and the method and apparatus of test
CN110297766A (en) * 2019-06-03 2019-10-01 合肥移瑞通信技术有限公司 Method for testing software and software testing system based on distributed test node cluster
CN110347520A (en) * 2019-06-28 2019-10-18 北京大米科技有限公司 Method, apparatus, electronic equipment and the medium of message distribution
CN111464380A (en) * 2020-03-19 2020-07-28 时时同云科技(成都)有限责任公司 Method, device and system for parallel testing of multiple service items

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113836024A (en) * 2021-09-27 2021-12-24 中南大学 Traffic multiplexing AB test method and system based on configuration drive
CN113836024B (en) * 2021-09-27 2024-02-06 中南大学 Configuration-driven flow multiplexing AB test method and system
CN114884855A (en) * 2022-07-11 2022-08-09 简单汇信息科技(广州)有限公司 Routing method and system under asynchronous communication

Similar Documents

Publication Publication Date Title
US8560956B2 (en) Processing model of an application wiki
CN100367201C (en) System and method for dynamically adding features to software applications
WO2004059612A1 (en) Methods and apparatus for displaying and replying to electronic messages
US9448781B2 (en) Application installer transmission system, server, and program
US8584116B2 (en) Installing method, installer, and installing program
CN113254235A (en) Message transmission method and device under multi-test environment
CN109995877A (en) Information-pushing method and device
CN110781373B (en) List updating method and device, readable medium and electronic equipment
US20200065740A1 (en) Task management method, terminal, and non-transitory computer-readable information recording medium
CN111444077A (en) Method and device for generating flow node test data
CN113010405A (en) Application program testing method and device
CN110084567A (en) E-seal application method, device, equipment and computer readable storage medium
CN112291325A (en) Message processing method and device and computer system
CN110618768B (en) Information presentation method and device
CN114500481A (en) Service request processing method, system and device
KR101597843B1 (en) Content management that addresses levels of functionality
KR101035560B1 (en) Service offering system and its method
CN115934076B (en) Cross-platform client micro-service providing device and method and electronic equipment
CN111626802A (en) Method and apparatus for processing information
CN115292635A (en) Page floor data display method, device, equipment and computer readable medium
CN108600255A (en) Mock service management method, device, computer equipment and storage medium
CN114661274A (en) Method and device for generating intelligent contract
CN115525834A (en) Method for screening and displaying messages, computer device and recording medium
CN111143740B (en) Information processing method and device and electronic equipment
CN113590243A (en) Energy enterprise project creation method and device, computer equipment and medium

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