[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN114884915B - Message processing method, device and equipment based on gray release - Google Patents

Message processing method, device and equipment based on gray release Download PDF

Info

Publication number
CN114884915B
CN114884915B CN202210412726.0A CN202210412726A CN114884915B CN 114884915 B CN114884915 B CN 114884915B CN 202210412726 A CN202210412726 A CN 202210412726A CN 114884915 B CN114884915 B CN 114884915B
Authority
CN
China
Prior art keywords
message
application instance
gray
target
attribute field
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.)
Active
Application number
CN202210412726.0A
Other languages
Chinese (zh)
Other versions
CN114884915A (en
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.)
Alibaba China Co Ltd
Original Assignee
Alibaba China 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 Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN202210412726.0A priority Critical patent/CN114884915B/en
Publication of CN114884915A publication Critical patent/CN114884915A/en
Application granted granted Critical
Publication of CN114884915B publication Critical patent/CN114884915B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/07User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail characterised by the inclusion of specific contents
    • H04L51/18Commands or executable codes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/06Message adaptation to terminal or network requirements

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application provides a message processing method, device and equipment based on gray release. The method comprises the following steps: generating a first message through a message producer of a first application instance, wherein the first message comprises a gray attribute field, the gray attribute field is included in a field for indicating a message custom attribute, the value of the gray attribute field is used for indicating that the first message belongs to a gray message, the first application instance is an application instance running in a gray environment in a target call link, the first message is sent to an MQ through the message producer of the first application instance, and then at least one second application instance is run based on the first message in the MQ to obtain a running result of the target call link, and the at least one second application instance comprises an application instance which is called after the first application instance in the target call link. The accurate control of the gray scale flow is realized, and further, the accurate verification of the gray scale application instance on the target call link is realized.

Description

Message processing method, device and equipment based on gray release
Technical Field
The present disclosure relates to the field of network technologies, and in particular, to a message processing method, device, and equipment based on gray level distribution.
Background
When a new software version is released, the new software version running in the gray environment is verified through a small part of the user traffic (namely the gray traffic), and the gray traffic is gradually increased until all the user traffic is migrated to the new software version under the condition that no abnormality occurs in verification.
In the above-mentioned gray scale release process, it is desirable to be able to precisely control the gray scale flow so that the gray scale flow passes through all software versions in the gray scale environment in the call link, so as to ensure the accuracy and integrity of verification of the new software version. However, when asynchronous transmission of a message exists in a call link, it cannot be ensured that a gray message is always forwarded in a gray environment, so how to accurately control gray traffic in the case of asynchronous transmission of a gray release existence message is a problem to be solved at present.
Disclosure of Invention
The embodiment of the application provides a message processing method, device and equipment based on gray level release, which aim to accurately control gray level flow under the condition that gray level release exists in asynchronous transmission of messages.
In a first aspect, an embodiment of the present application provides a message processing method based on gray release, including: generating a first message by a message producer of a first application instance, wherein the first message comprises a gray attribute field, the gray attribute field is included in a field for indicating the message custom attribute, the value of the gray attribute field is used for indicating that the first message belongs to the gray message, and the first application instance is an application instance running in a gray environment in a target call link; sending the first message to the MQ by a message producer of the first application instance; and running at least one second application instance based on the first message in the MQ to obtain a running result of the target call link, wherein the at least one second application instance comprises an application instance which is called after the first application instance in the target call link.
In a second aspect, an embodiment of the present application provides a message processing method based on gray release, including: receiving a first message sent by an application server through a message producer of a first application instance, wherein the first message comprises a gray attribute field, the gray attribute field is included in a field indicating a message custom attribute, and the value of the gray attribute field is used for indicating that the first application instance belongs to a gray environment; determining a first message filtering rule met by the gray attribute field, wherein the first message filtering rule corresponds to a target application instance; the first message is sent to a message consumer of the target application instance.
In a third aspect, an embodiment of the present application provides a message processing apparatus, including: the message processing unit is used for generating a first message through a message producer of a first application instance, wherein the first message comprises a gray attribute field, the gray attribute field is included in a field for indicating the message custom attribute, the value of the gray attribute field is used for indicating that the first message belongs to the gray message, and the first application instance is an application instance running in a gray environment in a target call link; a message receiving and transmitting unit, configured to send, by a message producer of the first application instance, the first message to a message queue MQ; and the application running unit is used for running at least one second application instance based on the first message in the MQ to obtain a running result of the target calling link, wherein the at least one second application instance comprises an application instance which is called after the first application instance in the target calling link.
In a fourth aspect, an embodiment of the present application provides a message processing apparatus, including: a message receiving and transmitting unit, configured to receive a first message sent by an application server through a message producer of a first application instance, where the first message includes a gray attribute field, the gray attribute field is included in a field indicating a message custom attribute, and a value of the gray attribute field is used to indicate that the first application instance belongs to a gray environment; a rule processing unit, configured to determine a first message filtering rule that the gray attribute field meets, where the first message filtering rule corresponds to a target application instance; the messaging unit is also configured to send the first message to a message consumer of the target application instance.
In a fifth aspect, embodiments of the present application provide an electronic device, including: at least one processor and memory; the memory stores computer-executable instructions; the at least one processor executing computer-executable instructions stored in the memory causes the at least one processor to perform the method as provided in the first aspect, or the second aspect.
In a sixth aspect, embodiments of the present application provide a computer-readable storage medium having stored therein computer-executable instructions that, when executed by a processor, implement a method as provided in the first or second aspects.
In a seventh aspect, embodiments of the present application provide a computer program product comprising computer instructions which, when executed by a processor, implement the method of the first or second aspects or provision.
In the embodiment of the application server side, the first message is generated by the message producer of the first application instance, and the generated first message carries the gray attribute field so as to realize whether the message is a gray message or not through the gray attribute field, so that the gray message can be forwarded in a gray environment, the accurate control of gray flow is realized, and the accurate verification of the gray application instance (namely the application instance of gray release) on the target call link is further realized.
Drawings
Fig. 1 is a schematic view of a gray level publishing scene provided in an embodiment of the present application;
fig. 2 is a schematic flow chart of a message processing method based on gray release according to an embodiment of the present application;
fig. 3 is an interactive flow diagram of a message processing method based on gray release according to an embodiment of the present application;
FIG. 4 is a schematic block diagram of a message processing apparatus according to an embodiment of the present application;
FIG. 5 is a schematic block diagram of a message processing apparatus according to an embodiment of the present application;
Fig. 6 is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present application.
Detailed Description
Fig. 1 is a schematic view of a gray level publishing scene according to an embodiment of the present application. As shown in fig. 1, the application server 110 may have a plurality of application instances (such as application instances a, b, and c in the drawing) that complete the publishing, and the published plurality of application instances are hereinafter referred to as application instances running in the baseline environment. The multiple application instances have a calling relationship, can form a calling link A, and can realize application functions of an application program or partial function modules of the application program by operating the calling link A. When a software version update for all or part of the application instances among the plurality of application instances is required, the updated application instance may be run in a gray scale environment (hereinafter referred to as a gray scale application instance) to implement gray scale release for the application instance.
Taking the example of gray release of an application instance a and an application instance B in a plurality of application instances as shown in fig. 1, a gray application instance a ', a gray application instance B' and a gray application instance c form a call link B. Gateway 120 may divide the acquired user request traffic into a gray scale traffic and a baseline traffic, input the gray scale traffic into call link B to verify the newly published gray scale application instance a 'and gray scale application instance B', and input the baseline traffic into call link a to implement gray scale publication. Optionally, in the initial stage of gray level release, the smaller flow may be divided into gray level flow and the larger flow may be divided into baseline flow, and in the case that the operation result of the call link B is not abnormal, the gray level flow may be gradually increased and the baseline flow may be decreased until all the user flows are migrated to the call link B, so as to complete gray level release.
The application instance may be a software module or may be a piece of program code.
It should be noted that, in an actual application scenario, the call link may include more or fewer application instances, which is not limited in this application.
Based on the above example, the full-link gray scale is to issue gray scale in a manner of precisely controlling inter-process traffic, so that both the gray scale traffic and the baseline traffic are respectively forwarded in the respective call links. For example, the gray application instance a 'in fig. 1 calls the gray application instance b' after running, and does not call the application instance b; for another example, application instance a invokes application instance b after running, but not gray scale application instance b'. On one hand, the gray scale flow can complete closed loop in the gray scale environment without missing some gray scale application examples to be verified, thereby improving the accuracy and the integrity of verification of the newly released software version; on the other hand, the baseline flow always runs in the baseline environment, so that the problem that whether the abnormal problem is caused by a newly released global version cannot be positioned when the abnormal is verified is avoided.
In general, the forwarding of inter-process traffic includes two ways:
Mode one, synchronous transmission mode. Taking synchronous sending of the information between the application instance b and the application instance c as an example, in the synchronous sending process, the application instance b sends the information to the application instance c, the application instance c processes the information after receiving the information, and sends a response message back to the application instance b. Alternatively, the application instance b may invoke the application instance c, for example by means of a remote procedure call (Remote Procedure Call, RPC), to achieve synchronous sending of messages.
Mode two, asynchronous transmission mode. Taking asynchronous transmission of the Message between the gray application instance a ' and the gray application instance b ' as an example, in the asynchronous transmission process, the gray application instance a ' transmits the Message to a Message Queue (MQ) for Message caching, and the gray application instance b ' acquires the Message of the gray application instance a ' from the MQ, so that asynchronous transmission of the Message is realized.
Alternatively, the MQ may be deployed at a Broker Server (Broker Server) 130, or the related functions of the MQ may be provided by the Broker Server.
In the first manner, the application server 110 may ensure that the message is sent to the corresponding application instance c by sending the message synchronously through the application instance b. However, in the second mode, after the application server 110 sends the message to the MQ through the gray application instance a ', the message may be acquired by the application instance b or the application instance b', and in this case, the verification environment of the full link gray is damaged, which affects the accuracy of verification.
Aiming at the technical problems, the embodiment of the application provides a message processing method, which introduces a gray attribute field, and in the asynchronous sending process of the message, an application instance can realize the filtering of the message based on the gray attribute field, thereby realizing the accurate control of gray flow and further improving the accuracy of gray verification.
It should be noted that, the application server 110 and the transit server 130 in fig. 1 may be implemented as a common server, a server cluster, or a cloud server, a server cluster. And the application server 110 and the transit server 130 may be deployed in the same or different server clusters, which is not limited in this application.
It should also be understood that the application server 110 and the relay server 130 are both deployed with a message queue system, for example, a client of the application server 110 deployed with the message queue system, and the relay server 130 deployed with a server of the message queue system. The message queue system can be, for example, a RocketMQ system, which is a distributed and open-source message queue system, has the characteristics of low delay, high concurrency, high availability, high reliability, expandability, trillion-level capacity and the like, and is widely applied in the field of message processing, and the RocketMQ system, like other types of message queue systems, also supports the release and subscription of messages, and also supports some characteristic functions such as transaction messages, timing messages, realization of delay messages and the like.
The following first describes the terminology relevant to the present application.
1. Message Producer (Producer): for generating a message for an application instance and sending the generated message to an MQ, such as the staging server 130 in fig. 1 described above. The manner in which the message producer sends the message includes, but is not limited to: at least one of synchronous transmission mode, asynchronous transmission mode, sequential transmission mode, and single transmission mode. The synchronous transmission mode and the asynchronous mode both need the transfer server to return the confirmation information, and the unidirectional transmission mode does not need the transfer server to return the confirmation information.
2. Message Producer Group (Producer Group): message producers that send messages of the same type are referred to as a message producer group.
3. Message Consumer (Consumer): for asynchronously consuming messages on the MQ. Consumer forms provided from an application perspective include, but are not limited to: pull-type consumption and push-type consumption.
4. Message Consumer Group (Consumer Group): message consumers that consume the same class of messages and consume a logically consistent set of messages are referred to as a message consumer group. The group of message consumers makes it very easy to achieve the goals of load balancing and fault tolerance in terms of message consumption. It should be appreciated that message consumers of a message consumer group consume messages in the same Topic (Topic). Message consumer groups support message consumption modes including, but not limited to: cluster consumption (managing) and broadcast consumption (Broadcasting).
5. Topic: is a logical classification of messages, e.g. order class messages, inventory class messages, respectively corresponding to different topics.
6. Message filtering: including but not limited to Tag (Tag) filtering and structured query language (Structured Query Language SQL) 92 filtering. SQL92 is one of the ANSI/ISO standards for databases. It defines a language (SQL) and the behavior of the database (transaction, isolation level, etc.).
Tag filtration: a Tag may be considered a further refinement to Topic, e.g., a message consumer whose Topic is an order message may further subscribe to the Tag as a message for an order to be paid. Besides specifying Topic, message consumer can specify Tag when subscribing message, after message consumer pulls message, message consumer can check Tag character string of message, if Tag character string of message is identical with specified Tag when subscribing message, then message is consumed, if Tag character string of message is not identical with specified Tag when subscribing message, then message is discarded, and message consumption is not carried out.
In general, tags can only specify one application attribute of a message, and when a message to which a message consumer needs to subscribe has multiple attributes, it is difficult to filter a message by the Tag.
SQL92 filtering: besides specifying Topic, the message consumer can also specify SQL92 expression when subscribing to the message, and the transit server builds and executes the SQL92 expression, so that the message consumer consumes the message meeting the SQL92 expression.
The message processing method provided in the embodiment of the present application is described in detail below with reference to the accompanying drawings.
Fig. 2 is a flow chart of a message processing method based on gray release according to an embodiment of the present application. The execution body of the embodiment of the present application may be an application server, for example, application server 110 in fig. 1, and in some embodiments, the application server may execute a related process executed by the relay server, in other words, the relay server may be integrated with the application server. As shown in fig. 2, the method includes:
s210, generating a first message by a message producer of a first application instance, wherein the first message comprises a gray attribute field, the gray attribute field is included in a field for indicating the custom attribute of the message, the value of the gray attribute field is used for indicating that the first message belongs to the gray message, and the first application instance is an application instance running in a gray environment in a target call link;
s220, sending the first message to a message queue MQ through a message producer of the first application instance;
S230, based on the first message in the MQ, at least one second application instance is operated, and an operation result of the target call link is obtained.
It should be noted that the target call link includes a plurality of application instances, and the plurality of application instances includes at least one application instance running in a gray environment, and the first application instance may be any one of the at least one application instance running in the gray environment. For example, the target call link may be call link B in fig. 1, and the first application instance may cause the gray application instance a 'or the gray application instance B' in call link B.
It should also be appreciated that the at least one second application instance may include an application instance in the target call link that is invoked after the first application instance. For example, the first application instance is a gray application instance a 'in the invocation link B, and the at least one second application instance may include a gray application instance B' and an application instance c.
In S210, the first message generated by the application server through the first application instance carries a gray attribute field. The gray attribute field may be, for example, the attribute field identified by the SQL92 filter described above. The value of the gray attribute field is used to indicate that the first message belongs to a gray message, and of course, if the value of the gray attribute field carried by the message generated by the application instance running in the baseline environment is used to indicate that the message belongs to the baseline message.
Optionally, the gray attribute field may be a user attribute (user-property) field, or a part of fields in the user-property field, where the user-property field may be used to indicate a message custom attribute, so as to implement definition of an additional message attribute by a user.
Optionally, in the embodiment of the present application, the message producer of the first application instance may modify the user-property field through a Hook function (Hook) to implement adding the gray attribute field to the first message. The Hook may be implemented based on Java Agent technology.
In S220, the application server may send the first message to the MQ deployed by the application server through the message producer of the first application instance, or send the first message to the MQ deployed by the relay server, which is not limited in this application.
In S230, the application server continues to call at least one second application instance after the first application instance in the target call link, so as to complete the target call link, and obtain an operation result of the target call link, where the operation result may be used to verify each gray application instance in the target call connection. It should be appreciated that the second application instance may include a gray scale application instance in a gray scale environment and/or an application instance in a baseline environment.
In the embodiment of the application server side, the first message is generated by the message producer of the first application instance, and the generated first message carries the gray attribute field so as to realize whether the message is a gray message or not through the gray attribute field, so that the gray message can be forwarded in a gray environment, the accurate control of gray flow is realized, and the accurate verification of the gray application instance (namely the application instance of gray release) on the target call link is further realized.
In some embodiments, the application server obtains the first message sent by the MQ through a message consumer of a target application instance, which may be an application instance having a neighboring call relationship with the first application instance, among the at least one second application instance, for example, the first application instance is a grayscale application instance a 'in the call link B, and the target application instance may be a grayscale application instance B'.
Continuing with the above embodiment, the message subscribed to by the message consumer of the target application instance satisfies the first message filtering rule. For example, the first message filtering rule may include a value of the gray attribute field indicating that the message is a gray message, in other words, when the value of the gray attribute field indicates that the message is a gray message, the message satisfies the first message filtering rule. As described above, since the first application instance runs in the gray scale environment, the gray scale attribute field carried by the first message generated by the first application instance indicates that the first message is a gray scale message, and then the first message meets the first message filtering rule. In this case, the application server may obtain the first message from the MQ.
Alternatively, the first message filtering rule may be a message filtering rule constructed based on the above-described SQL92 expression.
It should be understood that the first message filtering rules are only one of the message filtering rules and are not representative of being related to the first message, and the first message filtering rules should not be understood as filtering rules of the first message.
The first message filtering rule that generates the target application instance is illustrated by two possible examples:
the first example may be that the target application instance is an application instance running in a gray scale environment, i.e. the target application instance is a gray scale application instance. The application server may generate a first message filtering rule according to a gray environment in which the target application instance is located. For example, the application server may generate the first message filtering rule by a filtering rule generator during message consumer initialization. Further, the application server may obtain the first message filtering rule based on a Java Agent technology, and fuse the first message filtering rule with other preset message filtering rules. For example, when the other preset message filtering rule is a rule based on Tag filtering, the Tag filtering rule may be firstly converted into the SQL92 filtering rule by grammar, and then the first message filtering rule is added.
The second example, the target application instance, may be an application instance running in a baseline environment, i.e., the target application instance is a baseline application instance. The application server may generate a second message filtering rule according to the baseline environment in which the target application instance is located. In general, the second message filtering rule may be used to filter messages whose gray attribute field value indicates that the message is a baseline message, but in two cases, the first message filtering rule described above needs to be added to the message filtering rule (including the second message filtering rule) of the baseline application instance: in the first case, the application instance with adjacent calling relation with the first application instance does not have a gray application instance, in this case, although the target application instance is a baseline application instance, gray messages are also required to be consumed, so that a first message filtering rule needs to be added; in the second case, the gray application instance (for example, the gray application instance b 'in fig. 1) having the adjacent call relationship with the first application instance (for example, the gray application instance a' in fig. 1) is deactivated (for example, the presence of an anomaly causes the gray message in the MQ to be consumed), in this case, the consumption of the gray message needs to be performed by the baseline application instance (for example, the baseline application instance c in fig. 1) having the adjacent call relationship with the first application instance, that is, the target application instance, and then the first message filtering rule needs to be added in the message filtering rules of the target application instance.
In any of the above embodiments, the MQ-related execution may also be performed by a staging server (e.g., staging server 130 in fig. 1). The method provided in the embodiment of the present application will be described in detail below by taking interaction between an application server (such as application server 110 in fig. 1) and a relay server as an example.
Of course, the related processes performed by the transit server may also be performed by the application server (e.g., MQ function module in the application server).
Fig. 3 is an interactive flow diagram of a message processing method based on gray release according to an embodiment of the present application. As shown in fig. 3, the method includes some or all of the following processes:
s310, the application server generates a first message through a message producer of a first application instance, wherein the first message comprises a gray attribute field, the gray attribute field is included in a field indicating the message custom attribute, the value of the gray attribute field is used for indicating that the first message belongs to the gray message, and the first application instance is an application instance running in a gray environment in a target call link.
S320, the application server sends a first message to the transfer server through a message producer of the first application instance; correspondingly, the transit server receives a first message sent by the application server through the first application instance.
S330, the transit server determines a first message filtering rule satisfied by the gray attribute field.
And S340, the transfer server sends the first message to a message consumer of the target application instance.
Correspondingly, the application server receives the first message sent by the transit server through the message consumer of the target application instance.
S350, the application server side operates at least one second application instance based on the first message to obtain an operation result of the target call link.
The above S310 and S350 are respectively illustrated in the embodiments related to S210 and S230 in the embodiment shown in fig. 2, and are not described herein.
In S320, the application server sends the first message to the transit server through the message producer of the first application instance, and the transit server may put the first message into the MQ.
In S330, the forwarding server may store a message filtering rule subscribed by the message consumer of each application instance in the target call link, and the forwarding server may determine, according to the gray attribute field of the first message received in S320, a first message filtering rule satisfied by the first message, and send the first message to the consumer of the target application instance corresponding to the first message filtering rule in S340, so that the target application instance consumes the first message.
In S350, the application server executes at least one second application instance based on the first message, for example, the application server consumes the first message through the target application instance, and executes the second application instance invoked after the target application instance is executed, until the target invoking link is executed, so as to obtain an operation result.
In some embodiments, S310 may also be preceded by at least part of the process of S360 to S380:
s360, the application server acquires a construction method of a message consumer of the target application instance, wherein the construction method comprises information indicating the environment of the target application instance,
and S370, the application server adds gray scale identification to the message consumer of the target application instance according to the construction method, wherein the gray scale identification is determined based on the environment in which the target application instance is located.
S380, the application server sends report information to the transfer server through the message consumer of the target application instance, wherein the report information comprises the gray scale mark carried by the message consumer.
Correspondingly, the transfer server receives the report information sent by the application server through the message consumer of the target application instance.
It should be noted that the construction method is a special method, which is a method similar to the above-mentioned method S360, S370 and S380. The creation of the object is accomplished by a construction method, and the function of the object is mainly to complete the initialization of the object. The construction method is automatically invoked when a class instantiates an object. The application server can identify information of an environment where the application instance indicated in the construction method is located based on Java Agent technology when a message consumer of any application instance (including a target application instance) is initialized, wherein the environment comprises a gray environment or a baseline environment, and further, the application server can add gray identification to the message consumer of the target application instance according to the construction method. Further, the application server side sends report information to the transfer server side through the message consumer of the target application instance, wherein the report information comprises the gray scale identifier carried by the message consumer, so that in the process of transferring the message by the transfer server side, the message consumer of the target application instance can be identified to be the message consumer of the gray scale application instance or the message consumer of the base line application instance based on the gray scale identifier.
In some embodiments, the method further comprises: and the application server periodically transmits heartbeat information to the transfer server through the message consumer of the target application instance, wherein the heartbeat information comprises the message filtering rule of the target application instance. Correspondingly, the transfer server receives heartbeat information periodically sent by the application server through the message consumer of the target application instance, wherein the heartbeat information comprises the message filtering rule of the target application instance. Based on the heartbeat information periodically sent by the application server, the relay server can acquire the latest message filtering rule of the message consumer of the target application instance, and then the relay server can update the message filtering rule of the message consumer of the target application instance according to the heartbeat information. For example, the period for the application server to send the heartbeat information may be 30s.
For example, the application server responds to the filtering rule adding request, and the first message filtering rule can be added to the message filtering rule of the target application instance, so that the message filtering rule of the target application instance is contained in the heartbeat information and is sent to the transit server. For another example, the application server may respond to the filtering rule adding request, and include the first message filtering rule in the heartbeat information and send the heartbeat information to the relay server, so that the relay server adds the first message filtering rule to the message filtering rule of the target application instance.
It should be noted that the foregoing description is only given by way of example of updating the message filtering rules of the message consumer of the target application instance, and should not be construed as limiting the present application. For example, the application server and the relay server may update message filtering rules for message consumers for any application instance in a similar manner.
It should be noted that, the descriptions of "first" and "second" herein are used to distinguish different application instances, messages, etc., and do not represent a sequence, and are not limited to "first" and "second" being different types.
Fig. 4 is a schematic block diagram of a message processing apparatus according to an embodiment of the present application. As shown in fig. 4, the apparatus 400 includes at least a message processing unit 410, a messaging unit 420, and an application running unit 430.
The message processing unit 410 may be configured to generate, by a message producer of a first application instance, a first message, where the first message includes a gray attribute field, the gray attribute field is included in a field indicating a message custom attribute, and a value of the gray attribute field is used to indicate that the first message belongs to a gray message, and the first application instance is an application instance running in a gray environment in a target call link; the messaging unit 420 may be configured to send the first message to a message queue MQ by a message producer of the first application instance; the application running unit 430 may be configured to run at least one second application instance based on the first message in the MQ, to obtain a running result of the target call link, where the at least one second application instance includes an application instance in the target call link that is invoked after the first application instance.
In some embodiments, the at least one second application instance comprises a target application instance, the value of the gray attribute field of the first message satisfying a first message filtering rule of the target application instance; the messaging unit 420 is further configured to, prior to running the target application instance: the first message sent by the MQ is obtained by a message consumer of the target application instance.
In some embodiments, the target application instance is an application instance running in a grayscale environment, and the apparatus 400 further includes: the rule processing unit 440 is configured to generate the first message filtering rule according to the gray scale environment where the target application instance is located.
In some embodiments, the target application instance is an application instance running in a baseline environment, and the rule processing unit 440 is further configured to: and in response to the filtering rule adding request, adding the first message filtering rule in the message filtering rule of the target application instance.
In some embodiments, the apparatus 400 further comprises: and the information reporting unit 450 is configured to periodically send heartbeat information to the transit server through the message consumer of the target application instance, where the heartbeat information includes a message filtering rule of the target application instance.
In some embodiments, the apparatus 400 further comprises: a consumer identification unit 460, configured to obtain a construction method of the message consumer of the target application instance, where the construction method includes information indicating an environment in which the target application instance is located, and according to the construction method, add a gray identification to the message consumer of the target application instance, where the gray identification is determined based on the environment in which the target application instance is located.
In some embodiments, after the gray scale identifier is added to the message consumer of the target application instance according to the construction method, the information reporting unit 450 is further configured to send, to the forwarding server, reporting information through the message consumer of the target application instance, where the reporting information includes the gray scale identifier carried by the message consumer.
In some embodiments, the messaging unit 420 is specifically configured to send the first message to the relay server through the message producer of the first application instance.
It should be understood that the specific process of each unit performing the corresponding steps has been described in detail in the above method embodiments, and is not described herein for brevity.
Fig. 5 is a schematic block diagram of a message processing apparatus according to an embodiment of the present application. As shown in fig. 5, the apparatus 500 includes at least a messaging unit 510 and a rule processing unit 520.
The messaging unit 510 may be configured to receive a first message sent by an application server through a message producer of a first application instance, where the first message includes a gray attribute field, the gray attribute field is included in a field indicating a custom attribute of the message, and a value of the gray attribute field is used to indicate that the first application instance belongs to a gray environment; the rule processing unit 520 may be configured to determine a first message filtering rule that the gray attribute field satisfies, where the first message filtering rule corresponds to the target application instance; the messaging unit 510 is also configured to send the first message to a message consumer of the target application instance.
In some embodiments, the apparatus 500 further comprises: an information obtaining unit 530, configured to receive heartbeat information periodically sent by the application server through the message consumer of the target application instance, where the heartbeat information includes a message filtering rule of the target application instance; the rule processing unit 520 is further configured to update the message filtering rules of the message consumer of the target application instance according to the heartbeat information.
In some embodiments, the information obtaining unit 530 is further configured to receive reporting information sent by the application server through the message consumer of the target application instance, where the reporting information includes a gray identifier carried by the message consumer.
It should be understood that the specific process of each unit performing the corresponding steps has been described in detail in the above method embodiments, and is not described herein for brevity.
Fig. 6 is a schematic structural diagram of an electronic device according to an exemplary embodiment of the present application. The electronic device 600 may be an implementation of the application server or the transit server in the above method embodiment. As shown in fig. 6, the electronic device 600 includes: a memory 610 and a processor 620.
Memory 610, for storing computer programs, may be configured to store other various data to support operations on the cloud server. The memory 610 may be an object store (Object Storage Service, OSS).
A processor 620, coupled to the memory 610, is configured to execute the computer program in the memory 610 for implementing the method implemented by the application server or the relay server in the above method embodiments.
Further, as shown in fig. 6, when the electronic device is implemented as a cloud server, the method further includes: firewall 630, load balancer 640, communication component 650, power component 660, and other components. Only some of the components are schematically shown in fig. 6, which does not mean that the server only comprises the components shown in fig. 6.
It should be appreciated that the electronic device 600 shown in fig. 6 is capable of implementing the various processes related to the application server or the relay server in the method embodiments above. The operations and/or functions of the respective modules in the electronic device 600 are respectively for implementing the respective flows in the above-described method embodiments. Reference is specifically made to the description in the above method embodiments, and detailed descriptions are omitted here as appropriate to avoid repetition.
The application also provides a processing device, which comprises at least one processor, wherein the at least one processor is used for executing the computer program stored in the memory, so that the processing device executes the method executed by the application server or the transit server in the embodiment of the method.
The embodiment of the application also provides a processing device which comprises a processor and an input/output interface. The input-output interface is coupled to the processor. The input-output interface is used for inputting and/or outputting information. The information includes at least one of instructions and data. The processor is configured to execute the computer program, so that the processing device executes the method executed by the application server or the relay server in the method embodiment described above.
The embodiment of the application also provides a processing device, which comprises a processor and a memory. The memory is used for storing a computer program, and the processor is used for calling and running the computer program from the memory, so that the processing device executes the method executed by the application server or the transfer server in the method embodiment.
It should be understood that the processing means described above may be one or more chips. For example, the processing device may be a field programmable gate array (field programmable gate array, FPGA), an application specific integrated chip (application specific integrated circuit, ASIC), a system on chip (SoC), a central processing unit (central processor unit, CPU), a network processor (network processor, NP), a digital signal processing circuit (digital signal processor, DSP), a microcontroller (micro controller unit, MCU), a programmable controller (programmable logic device, PLD) or other integrated chip.
In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or by instructions in the form of software. The steps of a method disclosed in connection with the embodiments of the present application may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in the processor for execution. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory, and the processor reads the information in the memory and, in combination with its hardware, performs the steps of the above method. To avoid repetition, a detailed description is not provided herein.
It should be noted that the processor in the embodiments of the present application may be an integrated circuit chip with signal processing capability. In implementation, the steps of the above method embodiments may be implemented by integrated logic circuits of hardware in a processor or instructions in software form. The processor may be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, or discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present application may be embodied directly in hardware, in a decoded processor, or in a combination of hardware and software modules in a decoded processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory, and the processor reads the information in the memory and, in combination with its hardware, performs the steps of the above method.
It will be appreciated that the memory in embodiments of the present application may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The nonvolatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically Erasable EPROM (EEPROM), or a flash memory. The volatile memory may be random access memory (random access memory, RAM) which acts as an external cache. By way of example, and not limitation, many forms of RAM are available, such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous DRAM (SLDRAM), and direct memory bus RAM (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
According to the method provided by the embodiment of the application, the application further provides a computer program product, which comprises: computer program code which, when run on a computer, causes the computer to perform the method performed by the application server or the relay server in the method embodiments described above.
According to the method provided by the embodiment of the application, the application further provides a computer readable storage medium, and the computer readable storage medium stores program codes, when the program codes run on a computer, the computer is caused to execute the method executed by the application server or the transfer server in the embodiment of the method.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (13)

1. A message processing method based on gray level distribution, comprising:
Generating a first message by a message producer of a first application instance, wherein the first message comprises a gray attribute field, the gray attribute field is included in a field for indicating the custom attribute of the message, the value of the gray attribute field is used for indicating that the first message belongs to the gray message, and the first application instance is an application instance running in a gray environment in a target call link;
sending the first message to a message queue MQ by a message producer of the first application instance;
receiving a first message sent by the MQ through a message consumer of a target application instance;
and running at least one second application instance based on the first message in the MQ to obtain a running result of the target call link, wherein the at least one second application instance comprises an application instance which is called after the first application instance in the target call link, the at least one second application instance comprises the target application instance, and the value of the gray attribute field of the first message meets a first message filtering rule corresponding to the target application instance.
2. The method of claim 1, wherein the target application instance is an application instance running in a grayscale environment, the method further comprising:
And generating the first message filtering rule according to the gray environment where the target application instance is located.
3. The method of claim 1, wherein the target application instance is an application instance running in a baseline environment, the method further comprising:
and responding to a filtering rule adding request, and adding the first message filtering rule in the message filtering rule of the target application instance.
4. A method according to any one of claims 1 to 3, further comprising:
and periodically sending heartbeat information to a transfer server through the message consumer of the target application instance, wherein the heartbeat information comprises the message filtering rule of the target application instance.
5. A method according to any one of claims 1 to 3, further comprising:
a construction method of a message consumer for acquiring the target application instance, wherein the construction method comprises information indicating the environment in which the target application instance is located;
according to the construction method, gray scale identification is added to the message consumer of the target application instance, wherein the gray scale identification is determined based on the environment of the target application instance.
6. The method of claim 5, wherein after adding a gray scale identification to a message consumer of the target application instance according to the construction method, the method further comprises:
and sending report information to a transfer server through the message consumer of the target application instance, wherein the report information comprises a gray scale identifier carried by the message consumer.
7. A method according to any one of claims 1 to 3, wherein the sending the first message to a message queue by a message producer of the first application instance comprises:
and the message producer through the first application instance sends the first message to a transit server.
8. A message processing method based on gray level distribution, comprising:
receiving a first message sent by an application server through a message producer of a first application instance, wherein the first message comprises a gray attribute field, the gray attribute field is included in a field indicating a message custom attribute, the value of the gray attribute field is used for indicating that the first message belongs to a gray message, and the first application instance is an application instance running in a gray environment in a target call link;
Determining a first message filtering rule met by the gray attribute field, wherein the first message filtering rule corresponds to a target application instance;
and sending the first message to a message consumer of the target application instance.
9. The method of claim 8, wherein the method further comprises:
receiving heartbeat information periodically sent by the application server through the message consumer of the target application instance, wherein the heartbeat information comprises a message filtering rule of the target application instance;
and updating the message filtering rule of the message consumer of the target application example according to the heartbeat information.
10. The method according to claim 8 or 9, characterized in that the method further comprises:
and receiving reporting information sent by the application server through the message consumer of the target application instance, wherein the reporting information comprises a gray scale identifier carried by the message consumer.
11. A message processing apparatus, comprising:
the message processing unit is used for generating a first message through a message producer of a first application instance, wherein the first message comprises a gray attribute field, the gray attribute field is included in a field for indicating message custom attributes, the value of the gray attribute field is used for indicating that the first message belongs to a gray message, and the first application instance is an application instance running in a gray environment in a target call link;
A message receiving and transmitting unit, configured to send, by a message producer of the first application instance, the first message to a message queue MQ;
the message receiving and transmitting unit is further used for receiving a first message sent by the MQ through a message consumer of the target application instance;
the application running unit is used for running at least one second application instance based on the first message in the MQ to obtain a running result of the target call link, the at least one second application instance comprises an application instance which is called after the first application instance in the target call link, the at least one second application instance comprises the target application instance, and the value of the gray attribute field of the first message meets a first message filtering rule corresponding to the target application instance.
12. A message processing apparatus, comprising:
the message receiving and transmitting unit is used for receiving a first message sent by an application server through a message producer of a first application instance, wherein the first message comprises a gray attribute field, the gray attribute field is included in a field for indicating message custom attributes, the value of the gray attribute field is used for indicating that the first message belongs to a gray message, and the first application instance is an application instance running in a gray environment in a target call link;
A rule processing unit, configured to determine a first message filtering rule that is satisfied by the gray attribute field, where the first message filtering rule corresponds to a target application instance;
the messaging unit is further configured to send the first message to a message consumer of the target application instance.
13. An electronic device, comprising: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing computer-executable instructions stored in the memory causes the at least one processor to perform the method of any one of claims 1 to 10.
CN202210412726.0A 2022-04-19 2022-04-19 Message processing method, device and equipment based on gray release Active CN114884915B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210412726.0A CN114884915B (en) 2022-04-19 2022-04-19 Message processing method, device and equipment based on gray release

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210412726.0A CN114884915B (en) 2022-04-19 2022-04-19 Message processing method, device and equipment based on gray release

Publications (2)

Publication Number Publication Date
CN114884915A CN114884915A (en) 2022-08-09
CN114884915B true CN114884915B (en) 2024-03-26

Family

ID=82672454

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210412726.0A Active CN114884915B (en) 2022-04-19 2022-04-19 Message processing method, device and equipment based on gray release

Country Status (1)

Country Link
CN (1) CN114884915B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115499317B (en) * 2022-11-15 2023-04-07 阿里云计算有限公司 Gray scale verification method, electronic device and readable storage medium

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108376118A (en) * 2018-02-09 2018-08-07 腾讯科技(深圳)有限公司 Service delivery system, method, equipment and storage medium
CN108848092A (en) * 2018-06-20 2018-11-20 中国联合网络通信集团有限公司 The processing method and processing device of micro services gray scale publication based on call chain
CN109726099A (en) * 2018-04-12 2019-05-07 平安普惠企业管理有限公司 A kind of application gray scale dissemination method, device and equipment
CN110365502A (en) * 2018-03-26 2019-10-22 华为技术有限公司 A kind of method, apparatus and storage medium of service upgrade management
CN110650163A (en) * 2018-06-26 2020-01-03 马上消费金融股份有限公司 Gray scale publishing method, system, equipment and computer readable storage medium
CN110781013A (en) * 2019-10-25 2020-02-11 湖南御家科技有限公司 Gray scale publishing method, device, equipment and medium
CN111163085A (en) * 2019-12-29 2020-05-15 北京车与车科技有限公司 Gray level release scene optimization method
CN111586095A (en) * 2020-03-26 2020-08-25 中国平安财产保险股份有限公司 Micro-service-based gray scale publishing method and device, computer equipment and storage medium
CN111897542A (en) * 2020-08-31 2020-11-06 北京三快在线科技有限公司 Method and device for gray scale release
CN112685060A (en) * 2020-12-24 2021-04-20 深圳前海微众银行股份有限公司 Gray scale distribution method and device, terminal equipment and computer storage medium
CN113014651A (en) * 2021-03-03 2021-06-22 中国工商银行股份有限公司 Gray scale publishing method, application server and gray scale publishing system
CN113315824A (en) * 2021-05-26 2021-08-27 武汉悦学帮网络技术有限公司 Application gray level publishing method and device and application gray level publishing system
CN113342595A (en) * 2021-05-26 2021-09-03 北京奇艺世纪科技有限公司 Gray scale verification method, device, equipment and storage medium
WO2021243666A1 (en) * 2020-06-04 2021-12-09 深圳市欢太科技有限公司 Information processing method and system, and device, medium, chip and program
WO2022037272A1 (en) * 2020-08-21 2022-02-24 烽火通信科技股份有限公司 Gray release method, apparatus and device, and readable storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8645354B2 (en) * 2011-06-23 2014-02-04 Microsoft Corporation Scalable metadata extraction for video search
US10310851B2 (en) * 2011-06-29 2019-06-04 International Business Machines Corporation Automated generation of service definitions for message queue application clients
US9455996B2 (en) * 2011-10-03 2016-09-27 New York University Generating progressively a perfect hash data structure, such as a multi-dimensional perfect hash data structure, and using the generated data structure for high-speed string matching
US9667671B2 (en) * 2013-05-13 2017-05-30 Xerox Corporation Method and system for facilitating communication between message consumers and message producers
US10733018B2 (en) * 2018-04-27 2020-08-04 Paypal, Inc. Systems and methods for providing services in a stateless application framework

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108376118A (en) * 2018-02-09 2018-08-07 腾讯科技(深圳)有限公司 Service delivery system, method, equipment and storage medium
CN110365502A (en) * 2018-03-26 2019-10-22 华为技术有限公司 A kind of method, apparatus and storage medium of service upgrade management
CN109726099A (en) * 2018-04-12 2019-05-07 平安普惠企业管理有限公司 A kind of application gray scale dissemination method, device and equipment
CN108848092A (en) * 2018-06-20 2018-11-20 中国联合网络通信集团有限公司 The processing method and processing device of micro services gray scale publication based on call chain
CN110650163A (en) * 2018-06-26 2020-01-03 马上消费金融股份有限公司 Gray scale publishing method, system, equipment and computer readable storage medium
CN110781013A (en) * 2019-10-25 2020-02-11 湖南御家科技有限公司 Gray scale publishing method, device, equipment and medium
CN111163085A (en) * 2019-12-29 2020-05-15 北京车与车科技有限公司 Gray level release scene optimization method
CN111586095A (en) * 2020-03-26 2020-08-25 中国平安财产保险股份有限公司 Micro-service-based gray scale publishing method and device, computer equipment and storage medium
WO2021243666A1 (en) * 2020-06-04 2021-12-09 深圳市欢太科技有限公司 Information processing method and system, and device, medium, chip and program
WO2022037272A1 (en) * 2020-08-21 2022-02-24 烽火通信科技股份有限公司 Gray release method, apparatus and device, and readable storage medium
CN111897542A (en) * 2020-08-31 2020-11-06 北京三快在线科技有限公司 Method and device for gray scale release
CN112685060A (en) * 2020-12-24 2021-04-20 深圳前海微众银行股份有限公司 Gray scale distribution method and device, terminal equipment and computer storage medium
CN113014651A (en) * 2021-03-03 2021-06-22 中国工商银行股份有限公司 Gray scale publishing method, application server and gray scale publishing system
CN113315824A (en) * 2021-05-26 2021-08-27 武汉悦学帮网络技术有限公司 Application gray level publishing method and device and application gray level publishing system
CN113342595A (en) * 2021-05-26 2021-09-03 北京奇艺世纪科技有限公司 Gray scale verification method, device, equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于海量数据消息队列的性能比较及其优化;邰宇;;科技传播(03);全文 *
基于消息的系统异步集成框架设计与实现;柳吉庆;石磊;张军;;制造业自动化(10);全文 *

Also Published As

Publication number Publication date
CN114884915A (en) 2022-08-09

Similar Documents

Publication Publication Date Title
CN109739573B (en) Processing method and device for realizing API (application program interface) call and system for realizing API
CN112286503B (en) Method, device, equipment and medium for unified management of microservices of multiple registries
CN108196961B (en) Asynchronous message processing method, terminal, system and storage medium
CN111913818B (en) Method for determining dependency relationship between services and related device
CN108874558B (en) Message subscription method of distributed transaction, electronic device and readable storage medium
US10776107B2 (en) Microservice-based data processing apparatus, method, and program
CN107590072B (en) Application development and test method and device
US20200177391A1 (en) Sending cross-chain authenticatable messages
CN110300067B (en) Queue adjusting method, device, equipment and computer readable storage medium
CN106059825A (en) Distributed system and configuration method
CN109117252B (en) Method and system for task processing based on container and container cluster management system
CN107968805B (en) Event notification method and server
CN103324713B (en) Data processing method and device in multistage server and data processing system
CN114338738B (en) Rule engine and scene linkage realization method based on Actor model
CN109104368B (en) Connection request method, device, server and computer readable storage medium
CN113703954A (en) Message backup method and device, electronic equipment and computer storage medium
CN114884915B (en) Message processing method, device and equipment based on gray release
US8752071B2 (en) Identifying subscriber data while processing publisher event in transaction
CN109308219B (en) Task processing method and device and distributed computer system
CN112445851A (en) Plug-in ORM framework implementation method and device, electronic equipment and storage medium
CN116594752A (en) Flow scheduling method, device, equipment, medium and program product
CN112667491B (en) Function test method and device for virtual machine
CN112540838B (en) System resource scheduling method and device and computer storage medium
CN116186022A (en) Form processing method, form processing device, distributed form system and computer storage medium
CN113127219A (en) Data storage method, data acquisition device 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
GR01 Patent grant
GR01 Patent grant