CN113742093A - Message processing method, device, equipment and storage medium - Google Patents

Message processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN113742093A
CN113742093A CN202010479410.4A CN202010479410A CN113742093A CN 113742093 A CN113742093 A CN 113742093A CN 202010479410 A CN202010479410 A CN 202010479410A CN 113742093 A CN113742093 A CN 113742093A
Authority
CN
China
Prior art keywords
message
service
target
service end
test
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
CN202010479410.4A
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology 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 Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202010479410.4A priority Critical patent/CN113742093A/en
Publication of CN113742093A publication Critical patent/CN113742093A/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • 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)
  • 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)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention discloses a message processing method, a device, equipment and a storage medium, wherein the method comprises the following steps: acquiring a target message to be processed generated by a message production end, wherein the target message is generated by a service request sent by the message production end on an online service end or a test service end in a pre-sending environment; detecting whether a target message meets a preset message forwarding condition or not according to preset service configuration information of an online service end; and if the preset message forwarding condition is met, forwarding the target message to the test service end so as to process the target message in the test service end. By the technical scheme of the embodiment of the invention, the problem of message mishandling in the prior art can be solved, the test accuracy is improved, and the online quality of software products is ensured.

Description

Message processing method, device, equipment and storage medium
Technical Field
Embodiments of the present invention relate to computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for processing a message.
Background
During software product development, the pre-development environment is the transition from the test environment to the production environment. Some data which are not tested in the test environment can be verified in the pre-sending environment so as to ensure the online quality of the software product.
In the pre-sending environment, the new function of the software is the latest code, and other function codes are consistent with those in the production environment, so that the same message production end is often used for processing the service request sent by the online service end in the production environment and processing the service request sent by the test service end in the pre-sending environment. For example, the message production end is a service approval end, and the online service end may send the service request to the service approval end for approval processing. The test service end can also send the service request to the service approval end for approval processing.
However, in the process of implementing the present invention, the inventor finds that at least the following problems exist in the prior art:
whether the service approval end processes the service request sent by the online service end or the service request sent by the test service end, the service approval end only sends the approval result message of the same message queue theme, so that the online service end subscribing the theme can obtain the approval result message generated based on the service request sent by the test service end and process the approval result message, and the condition of message misprocessing exists, thereby causing test data loss, reducing test accuracy and being incapable of ensuring the online quality of software products.
Disclosure of Invention
The embodiment of the invention provides a message processing method, a message processing device, message processing equipment and a storage medium, which are used for solving the problem of message mishandling in the prior art, improving the test accuracy and ensuring the online quality of software products.
In a first aspect, an embodiment of the present invention provides a message processing method, which is applied to an online service end in a production environment, and the method includes:
acquiring a target message to be processed generated by a message production end, wherein the target message is generated by the message production end based on a service request sent by the online service end or a test service end in a pre-sending environment;
detecting whether the target message meets a preset message forwarding condition or not according to preset service configuration information of the online service end;
and if the preset message forwarding condition is met, forwarding the target message to the test service end so as to process the target message in the test service end.
In a second aspect, an embodiment of the present invention further provides a message processing apparatus, including:
a target message receiving module, configured to obtain a target message to be processed, where the target message is generated by a message production end based on a service request sent by the online service end or a test service end in a pre-sending environment;
the target message detection module is used for detecting whether the target message meets a preset message forwarding condition according to preset service configuration information of the online service end;
and the target message forwarding module is used for forwarding the target message to the test service end if the preset message forwarding condition is met so as to process the target message in the test service end.
In a third aspect, an embodiment of the present invention further provides an apparatus, where the apparatus includes:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a message processing method as in any embodiment of the invention.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the message processing method according to any embodiment of the present invention.
The embodiment of the invention has the following advantages or beneficial effects:
after an on-line service end in a production environment acquires a target message to be processed, which is generated by a message production end, whether the target message meets a preset message forwarding condition or not can be detected based on preset service configuration information of the on-line service end, namely whether the target message is generated based on a service request sent by a test service end in a pre-sending environment or not is detected, if the preset message forwarding condition is met, the target message is indicated to be processed by the test service end, and the target message can be forwarded to the test service end for processing, so that the condition of message misprocessing is avoided, the test accuracy is improved, and the on-line quality of a software product is ensured.
Drawings
Fig. 1 is a flowchart of a message processing method according to an embodiment of the present invention;
fig. 2 is a flowchart of a message processing method according to a second embodiment of the present invention;
fig. 3 is an example of a message processing procedure according to a second embodiment of the present invention;
fig. 4 is a schematic structural diagram of a message processing apparatus according to a third embodiment of the present invention;
fig. 5 is a schematic structural diagram of an apparatus according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a message processing method according to an embodiment of the present invention, which is applicable to a situation in which an online service end in a production environment performs message processing, so as to avoid that the online service end erroneously processes a message sent to a test service end in a pre-sending environment. The method may be performed by a message processing apparatus, which may be implemented by means of software and/or hardware, integrated in an online service end in a production environment. As shown in fig. 1, the method specifically includes the following steps:
s110, target information to be processed generated by the information production end is obtained, wherein the target information is generated by a service request sent by the information production end on the line service end or the test service end in a pre-sending environment.
Wherein the target message may be response data generated based on the service request by a producer (i.e., a message producer) in a producer-consumer model. The message production end can be a server which is common to the online service end in the production environment and the test service end in the pre-sending environment and is used for processing the service request to generate the target message. Illustratively, the message production side may be a service approval side for processing service approval requests in various services. The services may include, but are not limited to, a procurement service, a supply service, a call service, and an inventory service. For example, in the purchasing business, a purchasing business approval request may be generated based on information such as the quantity of purchased articles, unit price of the articles, purchasing responsibility and total purchasing price, and sent to a business approval terminal to approve whether to approve the purchase, and a corresponding target message may be generated based on the approval result.
The production environment may be an online environment, that is, an environment used by a user. An online business end in a production environment may refer to a server deployed in the production environment for processing a target business. The pre-release environment may refer to a pre-release environment. The pre-release environment may deploy new function code, with other function code consistent with that in the online environment. The prefiring environment data may be derived from production environment data, i.e. the prefiring environment and the production environment may share a database. The test service end in the pre-distribution environment may refer to a server deployed in the pre-distribution environment for processing the same target service. The target service processed in the test service end may refer to a service executed by using a new function code that includes a new function code that is not online. The target service processed in the test service terminal may refer to an executed service using the function code that has been brought online. For example, if a sub-service for purchasing electronic goods in the online purchasing service of version 1.0 is developed to obtain a purchasing service of version 2.0 for a pre-release test, the purchasing service of version 1.0 is used in the production environment, that is, the online service end is used for processing the purchasing service of version 1.0; the procurement business of version 2.0 is used in the pre-release environment, namely the procurement business of version 2.0 is used for processing by the test business end. Except that the sub-business of purchasing the electronic goods in the purchasing business of version 2.0 processed by the testing business end is the newly developed new function code, other sub-business codes are all consistent with the online code in the production environment.
Specifically, the online service end in the production environment may send the service request to the message production end when generating the service request, and the test service end in the pre-sending environment may also send the service request to the message production end when generating the request. When receiving a service request sent by an online service end or a service request sent by a test service end, the message production end can process the service request to generate a corresponding target message. The Message production end can send the target Message of the fixed subject to the Message distribution end, and store and distribute the Message in a Message Queue (MQ) mode so as to solve the problem of strong coupling between the producer and the consumer. The message distribution terminal can store the target message into the message queue corresponding to the theme based on the theme of the received target message, so that the online service terminal subscribing the theme can obtain the target message in the message queue, and the online service terminal can obtain the target message generated by the message production terminal. For example, the message topic of the target message generated by the message production end is: and the online service end can subscribe the message topic processInstance in advance, so that the online service end can obtain the target message with the topic of processInstance.
It should be noted that the test service does not subscribe to the message topic of the target message, that is, the process instant of the message topic, so as to prevent the test service from directly receiving the target message generated by the message production end, for example, receiving and processing the target message generated based on the service request sent by the online service, thereby avoiding the message of the test service being processed by mistake, and further preventing the test service from generating dirty data on the production environment database connected to the test service, so as to ensure the normal use of the software product.
S120, detecting whether the target message meets a preset message forwarding condition according to preset service configuration information of the online service end.
The preset service configuration information may be preset, and the preset service configuration information corresponds to a target service processed by the online service end. For example, the preset service configuration information of the online service end may include, but is not limited to: and the pre-sending service type corresponds to the pre-sending function service in the online service end. The service with the pre-sending function may refer to a new sub-service with a function that needs to be tested in the pre-sending environment in the target service. The pre-sent service type may refer to a service type to which a new function sub-service to be pre-sent tested belongs. For example, if the target service processed by the online service end is a purchasing service, a sub-service of purchasing electronic goods in the purchasing service is developed, and the remaining sub-services are not developed, the pre-issuing function service is: the sub-business of purchasing the electronic goods, and the corresponding pre-sent business type can be the electronic goods. The preset message forwarding condition may be a condition that is preset based on a service requirement and is satisfied by the target message when the target message is forwarded to the test service terminal for processing.
Specifically, the preset service configuration information may be obtained from a configuration file of the online service end, and whether the target message satisfies a preset message forwarding condition is detected based on the preset service configuration information, so as to determine whether the target message is generated based on a service request sent by the online service end or generated based on a service request sent by the test service end.
Exemplarily, the preset service configuration information includes: when the type of the pre-send service corresponding to the pre-send function service in the online service end, S120 may include: acquiring a target service type corresponding to a target message; matching the target service type with the pre-sent service type; and if the matching is successful, determining that the target message meets the preset message forwarding condition.
The target service type may refer to a service type corresponding to a service request based on the target message. For example, if a service request for purchasing electronic goods is generated based on information such as the number of electronic goods to be purchased, the unit price of the electronic goods, the purchasing person in charge, and the total purchase price, the target service type corresponding to the target message generated based on the service request is the electronic goods.
Specifically, when receiving a service request, a message production end may obtain a target service type in the service request, process the service request and generate a corresponding target message by calling a service interface corresponding to the target service type, and send the target service type as attribute information of the target message, so that when obtaining the target message, an online service end may obtain the target service type from the attribute information of the target message. The online service end can match the target service type with each pre-sent service type in the preset service configuration information, if the pre-sent service type identical to the target service type exists, the matching is successful, namely the target message is generated aiming at a service request corresponding to a new function sub-service which needs to be tested in a pre-sent environment in the target service, and needs to be processed in the test service end, and at this time, the target message can be determined to meet the preset message forwarding condition. If the pre-sent service type which is the same as the target service type does not exist, the matching failure is indicated, namely the target message is generated aiming at the service request corresponding to the on-line function sub-service in the target service, the processing in the service testing end is not needed, and the target message can be determined not to meet the preset message forwarding condition. By configuring the pre-sending service type corresponding to the pre-sending function service in the online service end, whether the target message needs to be forwarded or not can be accurately detected, and the target message detection accuracy is improved.
And S130, if the preset message forwarding condition is met, forwarding the target message to the test service end so as to process the target message in the test service end.
Specifically, if it is detected that the target message meets the pre-send message forwarding condition, it indicates that the target message is generated based on a service request sent by the test service end, that is, the target message should be processed by the test service end, and at this time, the target message can be forwarded to the test service end, so that the target message can be processed in the test service end, thereby avoiding message misprocessing of the online service end, and implementing message isolation processing in the pre-send environment and the production environment, thereby ensuring normal pre-send test of the test service end, obtaining complete test data, further improving test accuracy, and ensuring online quality of software products.
It should be noted that, if it is detected that the target message does not satisfy the preset message forwarding condition, it indicates that the target message is generated based on the service request sent by the online service end, that is, the target message should be processed by the online service end itself, and at this time, the target message is directly processed in the online service end without message forwarding, thereby ensuring normal use of the software product.
According to the technical scheme of the embodiment, after the on-line service end in the production environment acquires the target message to be processed, which is generated by the message production end, whether the target message meets the preset message forwarding condition is detected based on the preset service configuration information of the on-line service end, namely whether the target message is generated based on the service request sent by the test service end in the pre-sending environment is detected, if the preset message forwarding condition is met, it is indicated that the target message is to be processed by the test service end, and the target message can be forwarded to the test service end for processing, so that the condition of message misprocessing is avoided, the test accuracy is improved, and the on-line quality of a software product is ensured.
On the basis of the above technical solution, the preset service configuration information of the online service end may further include: message forwarding controls the switch state. The message forwarding control switch may be a switch for controlling whether the target message received by the on-line service end is forwarded to the test service end for processing. The message forwarding control switch state may be configured based on the current prefire test state. The current pre-sending test state may include a pre-sending test in-process state and a pre-sending test on-line state. The state in the pre-release test may refer to a state in which the developed new version target service is being subjected to the pre-release test in the pre-release environment. The on-line state of the pre-release test can refer to the state that the developed new version target service is on line after the pre-release test is completed in the pre-release environment. For example, when the current prefire test state is the prefire in-test state, the message forwarding control switch state may be set to the on state. When the current pre-sending test state is the on-line state of the pre-sending test, the state of the message forwarding control switch can be set to be the off state.
Exemplarily, the preset service configuration information includes: when the pre-send service type and the message forwarding control switch state corresponding to the pre-send function service in the online service end, S120 may include: acquiring a target service type corresponding to a target message; matching the target service type with the pre-sent service type; if the matching is successful, detecting whether the state of the message forwarding control switch is an opening state; and if the message is in the opening state, determining that the target message meets the preset message forwarding condition.
Specifically, when it is detected that the target service type is successfully matched with the pre-sent service type, it indicates that the target message is generated for a service request corresponding to a new function sub-service that needs to be tested in the pre-sent environment in the target service, and at this time, it may further detect whether the message forwarding control switch state is an on state; if the target message is in the open state, it indicates that the target service is currently being subjected to a pre-sending test, that is, the online service end executes an old version of the target service code, and the test service end executes a new version of the target service code, and at this time, it can be determined that the target message meets a preset message forwarding condition, so that the target message is forwarded, and the situation of message mishandling is avoided. If the message forwarding control switch is in the off state, it indicates that the pre-sending test of the target service is finished and the code is on line, that is, the on-line service end and the test service end both execute the target service code of the new version, and it is not necessary to distinguish the production environment and the pre-sending environment, and at this time, it can be determined that the target message does not satisfy the pre-set message forwarding condition, so that the target message can be directly processed in the on-line service end. By configuring the state of the message forwarding control switch, whether message forwarding is required currently can be effectively controlled, so that the situation that the message forwarding is still carried out after a new version target service code is on line is avoided, and the message processing efficiency and the resource utilization rate are improved.
On the basis of the above technical solution, the preset service configuration information of the online service end may further include: and the target test user identification with the forwarding operation authority. The test user may refer to a user who logs in the message production end and is used for processing a service request sent by the test service end in the pre-sending environment. The target test user identification may be, but is not limited to, an account name of the target test user having the forwarding operation right item. Illustratively, in the service approval end, an online user for processing a service request sent by an online service end in the production environment and a test user for processing a service request sent by a test service end in the pre-sending environment may be logged in, so that when the service approval request sent by the online service end is received, the online user performs approval and generates a corresponding target message, or when the service approval request sent by the test service end is received, the test user performs approval and generates a corresponding target message.
Exemplarily, the preset service configuration information includes: when the pre-issued service type corresponding to the pre-issued function service in the online service end and the target test user identifier having the forwarding operation authority, S120 may include: acquiring a target service type corresponding to a target message; matching the target service type with the pre-sent service type; if the matching is successful, acquiring the current test user identification currently logged in the message production end; determining whether the current test user has forwarding operation authority or not according to the current test user identifier and the target test user identifier; and if the forwarding operation authority exists, determining that the target message meets the preset message forwarding condition.
Specifically, when it is detected that the target service type is successfully matched with the pre-sent service type, it indicates that the target message is generated according to a service request corresponding to a new function sub-service that needs to be tested in the pre-sent environment in the target service, at this time, a current test user identifier that is currently logged in the message production end may be further obtained, and the current test user identifier is matched with each target test user identifier, if a target test user identifier that is the same as the current test user identifier exists, it indicates that the matching is successful, that is, the current test user has a forwarding operation authority, and needs to forward the message, at this time, it may be determined that the target message satisfies a preset message forwarding condition. If the target test user identifier which is the same as the current test user identifier does not exist, the matching failure is indicated, namely the current test user does not have the forwarding operation authority and does not need to forward the message, and at the moment, the target message can be determined not to meet the preset message forwarding condition. By configuring the target test user identification with the forwarding operation authority, the forwarding operation authority of the test user can be effectively controlled, the situation that any user can forward messages is avoided, and the test accuracy is further ensured.
Exemplarily, the preset service configuration information includes: when the pre-sent service type, the message forwarding control switch state and the target test user identifier having the forwarding operation authority corresponding to the pre-sent function service in the online service end are determined, S120 may include: acquiring a target service type corresponding to a target message; matching the target service type with the pre-sent service type; if the matching is successful, detecting whether the state of the message forwarding control switch is an opening state; if the current test user identifier is in the open state, acquiring the current test user identifier currently logged in the message production end; determining whether the current test user has forwarding operation authority or not according to the current test user identifier and the target test user identifier; and if the forwarding operation authority exists, determining that the target message meets the preset message forwarding condition.
Specifically, when the target service type of the target message is successfully matched with the pre-sent service type, the message forwarding control switch is in an on state, and the current test user has the forwarding operation right, it is determined that the target message meets the preset message forwarding condition, so that the situation that the message forwarding is still performed after the new version target service code is on line can be effectively avoided, the situation that any user can perform the message forwarding can be avoided, the test accuracy can be further ensured, and the message processing efficiency is improved.
On the basis of the above technical solution, before S120, the method may further include: acquiring a first subscription theme corresponding to a pre-sending environment and a second subscription theme corresponding to a production environment, which are pre-configured in an online service end; and if the first subscription theme is different from the second subscription theme, detecting whether the target message meets a preset message forwarding condition according to preset service configuration information of the online service end.
The first subscription topic corresponding to the pre-release environment may refer to a message queue topic subscribed by the test service end in the pre-release environment, so that a message of the first subscription topic may be received. The second subscription topic corresponding to the production environment may refer to a message queue topic subscribed by the online service end in the production environment, so that a message of the second subscription topic may be received. In this embodiment, when the online service end in the production environment is configured, a first subscription theme corresponding to the pre-release environment configured actually is different from a second subscription theme corresponding to the production environment. For example, the first subscription topic is: process instance _ pre, the second subscription topic is: processInstance. When the test service terminal in the pre-release environment is configured, the third subscription theme corresponding to the actually configured pre-release environment is the same as the fourth subscription theme corresponding to the production environment, for example, both the third subscription theme and the fourth subscription theme are configured as the first subscription theme. For example, the third subscription topic and the fourth subscription topic are both: processInstance _ pre.
Specifically, a first subscription topic different from a second subscription topic subscribed by the online service end may be applied to the message distribution end as the message topic subscribed by the test service end. A first subscription theme corresponding to the pre-sending environment and a second subscription theme corresponding to the production environment may be added in advance in a configuration file of the online service end in the production environment. When the online service end obtains the target message generated by the message production end, the configured first subscription theme and the second subscription theme can be obtained from the configuration file of the online service end, the first subscription theme is compared with the second subscription theme, if the first subscription theme is different from the second subscription theme, the service end which obtains the target message currently is the online service end which is in the production environment, and at this time, the operation of detecting whether the target message meets the preset message forwarding condition can be continuously executed. If the first subscription theme is the same as the second subscription theme, it indicates that the service end currently obtaining the target message is not an online service end in a production environment but a test service end in a pre-sending environment, and at this time, the message forwarding is not required and the processing can be directly performed in the test service end. By comparing the first subscription theme with the second subscription theme, whether the current business end is really the online business end in the production environment can be verified, so that the message processing efficiency and the test accuracy are further improved.
Example two
Fig. 2 is a flowchart of a message processing method according to a second embodiment of the present invention, where this embodiment describes, on the basis of the above embodiment, an obtaining manner of preset service configuration information of an online service end, and further describes, in detail, a message forwarding process of the online service end on this basis. Wherein explanations of the same or corresponding terms as those of the above embodiments are omitted.
Referring to fig. 2, the message processing method provided in this embodiment specifically includes the following steps:
s210, target information to be processed generated by the information production end is obtained, wherein the target information is generated by a service request sent by the information production end on the line service end or the test service end in a pre-sending environment.
Illustratively, fig. 3 gives an example of a message handling procedure. As shown in fig. 3, the message producing side generates a target message with a message subject Topic, as a processInstance based on the service request, and sends the target message and the message subject processInstance to the message distributing side. The online service end subscribes to the message Topic Topic in advance: and a processInstance, wherein the testing service end subscribes a message Topic Topic in advance: and processInstance _ pre, so that the message distribution end only sends the target message with Topic as processInstance to the online service end (see the solid line in FIG. 3), so that the online service end can obtain the target message.
S220, based on the on-line service end identification corresponding to the on-line service end, calling a configuration interface of the service configuration end, and acquiring preset service configuration information corresponding to the on-line service end.
The service configuration end can be preset and is used for configuring a configuration platform of various services in a unified manner. The online service end identifier may be used to distinguish different online service ends.
Specifically, preset service configuration information corresponding to each online service end in the production environment may be preconfigured in the service configuration end, and a correspondence between an identifier of each online service end and the preset service configuration information may be stored. As shown in fig. 3, by calling the configuration interface of the service configuration end, the preset service configuration information corresponding to the current online service end identifier can be quickly obtained. By utilizing the service configuration end, the preset service configuration information of each online service end can be uniformly configured, and the information configuration efficiency is improved.
And S230, detecting whether the target message meets a preset message forwarding condition according to preset service configuration information of the online service terminal.
S240, if the preset message forwarding condition is met, acquiring a first subscription theme corresponding to a pre-sending environment configured in the online service end in advance.
Specifically, when the target message meets the preset message forwarding condition, a first subscription theme, such as processlnstance _ pre, corresponding to the pre-sending environment may be obtained from a configuration file of the online service end.
And S250, sending the target message and the first subscription theme to a message distribution end so that the message distribution end sends the target message to a test service end based on the first subscription theme to process the target message in the test service end.
Specifically, as shown in fig. 3, the online service may send the target message and the first subscription topic process instance _ pre to the message originator (see the dotted line in fig. 3). Different subjects may correspond to different message queues so that messages of different subjects may be stored in different message queues. The message distribution terminal can store the target message into the message queue corresponding to the first subscription subject based on the first subscription subject, so that the test service terminal which subscribes the first subscription subject in advance can obtain the target message and process the target message, thereby ensuring the accuracy and effectiveness of message processing, further improving the test accuracy and ensuring the online quality of software products.
Exemplarily, the "processing the target message in the test service side" in S250 may include: the test service end acquires a third subscription theme corresponding to a pre-sending environment and a fourth subscription theme corresponding to a production environment, wherein the third subscription theme is pre-configured in the test service end; and if the test service end detects that the third subscription theme and the fourth subscription theme are the same as the first subscription theme, processing the target message.
When the test service terminal in the pre-release environment is configured, the third subscription theme corresponding to the actually configured pre-release environment is the same as the fourth subscription theme corresponding to the production environment, for example, both the third subscription theme and the fourth subscription theme are configured as the first subscription theme. For example, the third subscription topic and the fourth subscription topic are both: processInstance _ pre.
Specifically, when the test service end obtains the target message, the configured third subscription theme and the fourth subscription theme can be obtained from the configuration file of the test service end, and the third subscription theme is compared with the fourth subscription theme, if the third subscription theme is the same as the fourth subscription theme and both the third subscription theme and the fourth subscription theme are the first subscription theme, it is indicated that the service end currently obtaining the target message is indeed the test service end in the pre-sending environment, and the target message can be processed at this time, so that the situation of message misprocessing can be further avoided, the accuracy of message processing is ensured, and the test accuracy is further improved.
According to the technical scheme of the embodiment, the target message and the first subscription theme corresponding to the pre-sending environment are sent to the message distribution end, so that the message distribution end can send the target message to the second service for processing based on the first subscription theme, the accuracy and effectiveness of message processing can be ensured, the testing accuracy is improved, and the online quality of the software product is ensured.
The following is an embodiment of a message processing apparatus according to an embodiment of the present invention, which belongs to the same inventive concept as the message processing methods according to the above embodiments, and reference may be made to the above embodiment of the message processing method for details that are not described in detail in the embodiment of the message processing apparatus.
EXAMPLE III
Fig. 4 is a schematic structural diagram of a message processing apparatus according to a third embodiment of the present invention, which is applicable to a situation where an online service end in a production environment performs message processing, so as to avoid that the online service end erroneously processes a message sent to a test service end in a pre-sending environment. The apparatus may be integrated in an online service end in a production environment. As shown in fig. 4, the apparatus specifically includes: a target message receiving module 310, a target message detecting module 320, and a target message forwarding module 330.
The target message receiving module 310 is configured to obtain a target message to be processed, which is generated by a message production end, where the target message is generated by a service request sent by an online service end or a test service end in a pre-sending environment of the message production end; the target message detection module 320 is configured to detect whether the target message meets a preset message forwarding condition according to preset service configuration information of the online service end; the target message forwarding module 330 is configured to forward the target message to the test service end if a preset message forwarding condition is met, so as to process the target message in the test service end.
According to the technical scheme of the embodiment, after the on-line service end in the production environment acquires the target message to be processed, which is generated by the message production end, whether the target message meets the preset message forwarding condition or not can be detected based on the preset service configuration information of the on-line service end, namely whether the target message is generated based on the service request sent by the test service end in the pre-sending environment or not is detected, if the preset message forwarding condition is met, it is indicated that the target message is to be processed by the test service end, and the target message can be forwarded to the test service end for processing, so that the condition of message misprocessing is avoided, the test accuracy is improved, and the on-line quality of a software product is ensured.
Optionally, the preset service configuration information of the online service end includes: a pre-sending service type corresponding to a pre-sending function service in an online service end; a target message detection module 320 comprising:
a target service type obtaining unit, configured to obtain a target service type corresponding to the target message;
the target service type matching unit is used for matching the target service type with the pre-sent service type;
and the result determining unit is used for determining that the target message meets the preset message forwarding condition if the matching is successful.
Optionally, the preset service configuration information of the online service end further includes: a message forwarding control switch state configured based on a current prefiring test state; a result determination unit comprising:
the switch state detection subunit is used for detecting whether the message forwarding control switch state is an on state;
and the result determining subunit is used for determining that the target message meets the preset message forwarding condition if the target message is in the open state.
Optionally, the preset service configuration information of the online service end further includes: target test user identification with forwarding operation authority; a result determination unit or a result determination subunit, specifically configured to:
acquiring a current test user identifier currently logged in a message production end; determining whether the current test user has forwarding operation authority or not according to the current test user identifier and the target test user identifier; and if the forwarding operation authority exists, determining that the target message meets the preset message forwarding condition.
Optionally, the apparatus further comprises:
the subscription theme acquisition device is used for acquiring a first subscription theme corresponding to a pre-sending environment pre-configured in the online service end and a second subscription theme corresponding to a production environment before detecting whether the target message meets a preset message forwarding condition according to preset service configuration information of the online service end;
and the subscription theme comparison device is used for detecting whether the target message meets a preset message forwarding condition or not according to preset service configuration information of the online service end if the first subscription theme is different from the second subscription theme.
Optionally, the target message forwarding module 330 is specifically configured to:
acquiring a first subscription theme corresponding to a pre-sending environment configured in advance in an online service end; and sending the target message and the first subscription theme to a message distribution end so that the message distribution end sends the target message to a test service end based on the first subscription theme to process the target message in the test service end.
Optionally, the testing the service end includes:
the subscription theme acquisition module is used for acquiring a third subscription theme corresponding to a pre-sending environment and a fourth subscription theme corresponding to a production environment, wherein the third subscription theme is pre-configured in the test service end;
and the subscription theme comparison module is used for processing the target message if the test service end detects that the third subscription theme and the fourth subscription theme are the same as the first subscription theme.
Optionally, the apparatus further comprises:
and the preset service configuration information acquisition module is used for calling a configuration interface of the service configuration end based on the online service end identifier corresponding to the online service end before detecting whether the target message meets the preset message forwarding condition according to the preset service configuration information of the online service end, and acquiring the preset service configuration information corresponding to the online service end.
The message processing device provided by the embodiment of the invention can execute the message processing method provided by any embodiment of the invention, and has the corresponding functional module and beneficial effect of executing the message processing method.
It should be noted that, in the embodiment of the message processing apparatus, the included units and modules are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
Example four
Fig. 5 is a schematic structural diagram of an apparatus according to a fourth embodiment of the present invention. Fig. 5 illustrates a block diagram of an exemplary device 12 suitable for use in implementing embodiments of the present invention. The device 12 shown in fig. 5 is only an example and should not bring any limitations to the functionality and scope of use of the embodiments of the present invention.
As shown in FIG. 5, device 12 is in the form of a general purpose computing device. The components of device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. Device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, and commonly referred to as a "hard drive"). Although not shown in FIG. 5, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with device 12, and/or with any devices (e.g., network card, modem, etc.) that enable device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the device 12 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 20. As shown, the network adapter 20 communicates with the other modules of the device 12 via the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing by executing programs stored in the system memory 28, for example, to implement a message processing method provided by the embodiment of the present invention, the method includes:
acquiring a target message to be processed generated by a message production end, wherein the target message is generated by a service request sent by the message production end on an online service end or a test service end in a pre-sending environment;
detecting whether a target message meets a preset message forwarding condition or not according to preset service configuration information of an online service end;
and if the preset message forwarding condition is met, forwarding the target message to the test service end so as to process the target message in the test service end.
Of course, those skilled in the art will appreciate that the processor may also implement the solution of the method for determining the reserved inventory provided by any embodiment of the present invention.
EXAMPLE five
The present embodiment provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of a message processing method according to any of the embodiments of the present invention, the method comprising:
acquiring a target message to be processed generated by a message production end, wherein the target message is generated by a service request sent by the message production end on an online service end or a test service end in a pre-sending environment;
detecting whether a target message meets a preset message forwarding condition or not according to preset service configuration information of an online service end;
and if the preset message forwarding condition is met, forwarding the target message to the test service end so as to process the target message in the test service end.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer-readable storage medium may be, for example but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It will be understood by those skilled in the art that the modules or steps of the invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of computing devices, and optionally they may be implemented by program code executable by a computing device, such that it may be stored in a memory device and executed by a computing device, or it may be separately fabricated into various integrated circuit modules, or it may be fabricated by fabricating a plurality of modules or steps thereof into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (11)

1. A message processing method applied to an online service end in a production environment, the method comprising:
acquiring a target message to be processed generated by a message production end, wherein the target message is generated by the message production end based on a service request sent by the online service end or a test service end in a pre-sending environment;
detecting whether the target message meets a preset message forwarding condition or not according to preset service configuration information of the online service end;
and if the preset message forwarding condition is met, forwarding the target message to the test service end so as to process the target message in the test service end.
2. The method of claim 1, wherein the preset service configuration information of the online service end comprises: a pre-sending service type corresponding to a pre-sending function service in the on-line service end;
detecting whether the target message meets a preset message forwarding condition according to preset service configuration information of the online service terminal, wherein the detecting comprises the following steps:
acquiring a target service type corresponding to the target message;
matching the target service type with the pre-sent service type;
and if the matching is successful, determining that the target message meets a preset message forwarding condition.
3. The method of claim 2, wherein the preset service configuration information of the online service end further comprises: a message forwarding control switch state configured based on a current prefiring test state;
determining that the target message meets a preset message forwarding condition, including:
detecting whether the state of the message forwarding control switch is an opening state;
and if the target message is in the opening state, determining that the target message meets a preset message forwarding condition.
4. The method according to claim 2 or 3, wherein the preset service configuration information of the online service end further comprises: target test user identification with forwarding operation authority;
determining that the target message meets a preset message forwarding condition, including:
acquiring a current test user identifier currently logged in the message production end;
determining whether the current test user has forwarding operation authority or not according to the current test user identification and the target test user identification;
and if the target message has the forwarding operation authority, determining that the target message meets a preset message forwarding condition.
5. The method of claim 1, before detecting whether the target message satisfies a predetermined message forwarding condition according to predetermined service configuration information of the online service end, further comprising:
acquiring a first subscription theme corresponding to the pre-sending environment and a second subscription theme corresponding to the production environment, which are pre-configured in the online service end;
and if the first subscription theme is different from the second subscription theme, detecting whether the target message meets a preset message forwarding condition or not according to preset service configuration information of the online service end.
6. The method of claim 1, wherein forwarding the target message to the test service for processing the target message in the test service comprises:
acquiring a first subscription theme corresponding to the pre-sending environment pre-configured in the online service end;
and sending the target message and the first subscription theme to a message distribution end, so that the message distribution end sends the target message to the test service end based on the first subscription theme, and the target message is processed in the test service end.
7. The method of claim 6, wherein processing the target message in the test service comprises:
the test service end acquires a third subscription theme corresponding to the pre-sending environment and a fourth subscription theme corresponding to the production environment, which are pre-configured in the test service end;
and if the test service end detects that the third subscription theme and the fourth subscription theme are both the same as the first subscription theme, processing the target message.
8. The method of claim 1, before detecting whether the target message satisfies a predetermined message forwarding condition according to predetermined service configuration information of the online service end, further comprising:
and calling a configuration interface of a service configuration end based on the online service end identifier corresponding to the online service end to acquire preset service configuration information corresponding to the online service end.
9. A message processing apparatus, comprising:
a target message receiving module, configured to obtain a target message to be processed, where the target message is generated by a message production end based on a service request sent by the online service end or a test service end in a pre-sending environment;
the target message detection module is used for detecting whether the target message meets a preset message forwarding condition according to preset service configuration information of the online service end;
and the target message forwarding module is used for forwarding the target message to the test service end if the preset message forwarding condition is met so as to process the target message in the test service end.
10. An apparatus, characterized in that the apparatus comprises:
one or more processors;
a memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a message processing method as recited in any of claims 1-8.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a message processing method according to any one of claims 1 to 8.
CN202010479410.4A 2020-05-29 2020-05-29 Message processing method, device, equipment and storage medium Pending CN113742093A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010479410.4A CN113742093A (en) 2020-05-29 2020-05-29 Message processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010479410.4A CN113742093A (en) 2020-05-29 2020-05-29 Message processing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113742093A true CN113742093A (en) 2021-12-03

Family

ID=78725114

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010479410.4A Pending CN113742093A (en) 2020-05-29 2020-05-29 Message processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113742093A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115277761A (en) * 2022-07-19 2022-11-01 京东科技信息技术有限公司 Service message consumption method and device in same network environment

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130304885A1 (en) * 2012-05-09 2013-11-14 International Business Machines Corporation Managing a Subscription Hierarchy in Presence Systems
US20180167285A1 (en) * 2016-12-08 2018-06-14 Ixia Deploying a networking test tool in a cloud computing system
CN109151033A (en) * 2018-08-30 2019-01-04 百度在线网络技术(北京)有限公司 Communication means, device, electronic equipment and storage medium based on distributed system
CN110049118A (en) * 2019-04-12 2019-07-23 深圳乐信软件技术有限公司 Information push method, device, equipment and storage medium
CN110362473A (en) * 2019-05-31 2019-10-22 口口相传(北京)网络技术有限公司 Test optimization method and device, storage medium, the terminal of environment
CN110457141A (en) * 2019-07-04 2019-11-15 阿里巴巴集团控股有限公司 A kind of processing method of service message, system, device and equipment
CN110647459A (en) * 2018-06-27 2020-01-03 阿里巴巴集团控股有限公司 Application testing method and device
US20200073736A1 (en) * 2018-08-30 2020-03-05 Baidu Online Network Technology (Beijing) Co., Ltd. Message transmission method and apparatus, device and medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130304885A1 (en) * 2012-05-09 2013-11-14 International Business Machines Corporation Managing a Subscription Hierarchy in Presence Systems
US20180167285A1 (en) * 2016-12-08 2018-06-14 Ixia Deploying a networking test tool in a cloud computing system
CN110647459A (en) * 2018-06-27 2020-01-03 阿里巴巴集团控股有限公司 Application testing method and device
CN109151033A (en) * 2018-08-30 2019-01-04 百度在线网络技术(北京)有限公司 Communication means, device, electronic equipment and storage medium based on distributed system
US20200073736A1 (en) * 2018-08-30 2020-03-05 Baidu Online Network Technology (Beijing) Co., Ltd. Message transmission method and apparatus, device and medium
CN110049118A (en) * 2019-04-12 2019-07-23 深圳乐信软件技术有限公司 Information push method, device, equipment and storage medium
CN110362473A (en) * 2019-05-31 2019-10-22 口口相传(北京)网络技术有限公司 Test optimization method and device, storage medium, the terminal of environment
CN110457141A (en) * 2019-07-04 2019-11-15 阿里巴巴集团控股有限公司 A kind of processing method of service message, system, device and equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
孙琼;罗光峰;: "新一代运营系统中持续交付平台的实现", 电信技术, no. 03, 25 March 2017 (2017-03-25) *
王暖;王瑞坤;: "利用消息服务解决多业务应用系统的数据交换问题", 中国水运(理论版), no. 08, 20 August 2006 (2006-08-20) *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115277761A (en) * 2022-07-19 2022-11-01 京东科技信息技术有限公司 Service message consumption method and device in same network environment

Similar Documents

Publication Publication Date Title
US11763317B2 (en) Method of messaging service
EP3489825A1 (en) Method, apparatus and computer readable storage medium for processing service
WO2015088853A1 (en) Launching a client application based on a message
US10630399B2 (en) Testing distributed applications that have an established exchange in an advanced message queuing protocol (AMQP) message broker
CN111666539A (en) Real estate resource management method, device, server and storage medium
US7185086B2 (en) Method for electronic tracking of an electronic device
CN107861765B (en) Product configuration method, apparatus, and computer-readable storage medium
CN109828830B (en) Method and apparatus for managing containers
CN113742093A (en) Message processing method, device, equipment and storage medium
CN114372749A (en) Task processing method and device for unmanned vehicle
CN109218338B (en) Information processing system, method and device
CN113656307A (en) System capacity evaluation method, device, equipment and medium
CN113760500A (en) Service processing method, device, server and medium
CN113132522A (en) Test method, device, server and medium
CN110751464A (en) Information prompting method, device, equipment and storage medium
CN111626802A (en) Method and apparatus for processing information
CN113763094A (en) Service information processing method, device, server, medium and system
CN113392002B (en) Test system construction method, device, equipment and storage medium
CN114971785A (en) Order processing method and device, electronic equipment and storage medium
CN112261072B (en) Service calling method, device, equipment and storage medium
CN107704557B (en) Processing method and device for operating mutually exclusive data, computer equipment and storage medium
CN113157405A (en) Method and device for retrying breakpoint of business process
CN111383025B (en) Method and device for forwarding wind control data and electronic equipment
CN113819989B (en) Article packaging method, apparatus, electronic device and computer readable medium
CN115988060A (en) Data processing method, server and storage 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