CN112637046A - Message pushing method and routing device - Google Patents

Message pushing method and routing device Download PDF

Info

Publication number
CN112637046A
CN112637046A CN202011509424.2A CN202011509424A CN112637046A CN 112637046 A CN112637046 A CN 112637046A CN 202011509424 A CN202011509424 A CN 202011509424A CN 112637046 A CN112637046 A CN 112637046A
Authority
CN
China
Prior art keywords
message
message queue
target
identifier
queue
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
CN202011509424.2A
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 Fangtianxia Jiaju Network Technology Co ltd
Original Assignee
Beijing Fangtianxia Jiaju Network 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 Fangtianxia Jiaju Network Technology Co ltd filed Critical Beijing Fangtianxia Jiaju Network Technology Co ltd
Priority to CN202011509424.2A priority Critical patent/CN112637046A/en
Publication of CN112637046A publication Critical patent/CN112637046A/en
Pending legal-status Critical Current

Links

Images

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/21Monitoring or handling of messages
    • H04L51/214Monitoring or handling of messages using selective forwarding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The application provides a message pushing method and a routing device, which respond to a message distribution request sent by a publisher and acquire a message body and a routing key included in the message distribution request; acquiring a pre-stored target message queue identifier corresponding to the routing key; and writing the message body into a target message queue corresponding to the target message queue identification, triggering the first consumption end to acquire the message body from the target message queue, and pushing the message body to a target subscriber bound with the target message queue. Because the corresponding relation between the routing key and the message queue identification is stored in the routing device in advance, after the routing device receives the routing key sent by the publisher, the routing device can determine the target message queue identification, and writes the message body into the target message queue corresponding to the target message queue identification without storing a message pushing strategy in the publisher, so that under the condition of adding a subscriber, the relevant codes of the publisher are not required to be modified, and the code development and maintenance cost is reduced.

Description

Message pushing method and routing device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a message pushing method and a routing device.
Background
In the existing message pushing scheme, a publisher generates a message, and pushes the message to a queue corresponding to a subscriber subscribing to the message based on a pre-stored message pushing policy, and the subscriber acquires the message through the queue. In the existing message pushing scheme, a publisher needs to produce a message and store a message pushing strategy, the code complexity is high, and under the condition of increasing subscribers, the relevant codes of the publisher need to be modified, so that the code development and maintenance cost is high.
Disclosure of Invention
The application provides a message pushing method and a routing device, and aims to solve the problems that in the existing message pushing scheme, a publisher needs to produce a message and store a message pushing strategy, the code complexity is high, and under the condition that a subscriber is added, the relevant codes of the publisher need to be modified, so that the code development and maintenance cost is high.
In order to achieve the above object, the present application provides the following technical solutions:
a message pushing method is applied to a routing device, and comprises the following steps:
responding to a message pushing request sent by a publisher, and acquiring a message body and a routing key included in the message pushing request;
acquiring a pre-stored target message queue identifier corresponding to the routing key;
writing the message body into a target message queue corresponding to the target message queue identification, triggering a first consumption end to acquire the message body from the target message queue, and pushing the message body to a target subscriber bound with the target message queue; the first consuming side is any one of the consuming sides monitoring the target message queue.
Optionally, the obtaining of the pre-stored message queue identifier corresponding to the routing key includes:
analyzing the routing key to obtain a first identifier and a second identifier contained in the routing key;
determining a pre-stored message queue identifier set corresponding to the first identifier; wherein, the message queue identification set comprises at least one message queue identification;
and determining the message queue identifier corresponding to the second identifier in the message queue identifier set as a target message queue identifier.
The above method, optionally, further includes:
monitoring the total amount of message bodies in each message queue in real time;
judging whether the total amount of the message bodies in each message queue is greater than a preset threshold value or not;
and alarming the message queue with the total message body amount larger than a preset threshold value.
Optionally, in the above method, the process of triggering the first consuming end to push the message body to the target subscriber bound to the target message queue includes:
and triggering the first consuming end to forward configuration information based on an interface, determining the interface information of a target subscriber binding the target message queue, and pushing the message body to an interface corresponding to the interface information of the target subscriber, wherein the interface forwarding configuration information is acquired by the first consuming end in advance.
The above method, optionally, further includes:
triggering a second consumption end to judge whether the representation fed back by the target subscriber is received or not and successfully receive the feedback message of the message body within a preset time period, if so, deleting the message body from the target message queue, if not, acquiring the message body from the target message queue according to a preset period, and pushing the message body to the target subscriber until the representation fed back by the target subscriber is received and the feedback message of the message body is successfully received; and the second consuming side is any one of the consuming sides monitoring the target message queue.
A routing device, comprising:
the first obtaining unit is used for responding to a message pushing request sent by a publisher and obtaining a message body and a routing key included in the message pushing request;
the second acquisition unit is used for acquiring a pre-stored target message queue identifier corresponding to the routing key;
a writing unit, configured to write the message body into a target message queue corresponding to the target message queue identifier, trigger a first consuming end to obtain the message body from the target message queue, and push the message body to a target subscriber bound with the target message queue; the first consuming side is any one of the consuming sides monitoring the target message queue.
Optionally, in the apparatus described above, the second obtaining unit is configured to perform obtaining of a pre-stored message queue identifier corresponding to the routing key, and specifically configured to:
analyzing the routing key to obtain a first identifier and a second identifier contained in the routing key;
determining a pre-stored message queue identifier set corresponding to the first identifier; wherein, the message queue identification set comprises at least one message queue identification;
and determining the message queue identifier corresponding to the second identifier in the message queue identifier set as a target message queue identifier.
The above apparatus, optionally, further comprises:
the monitoring unit is used for monitoring the total amount of the message bodies in each message queue in real time;
the judging unit is used for judging whether the total amount of the message bodies in each message queue is greater than a preset threshold value or not;
and the alarm unit is used for alarming the message queue with the total message body amount larger than the preset threshold value.
Optionally, in the apparatus described above, the writing unit executes a process of triggering the first consuming end to push the message body to a target subscriber bound to the target message queue, and is specifically configured to:
and triggering the first consuming end to forward configuration information based on an interface, determining the interface information of a target subscriber binding the target message queue, and pushing the message body to an interface corresponding to the interface information of the target subscriber, wherein the interface forwarding configuration information is acquired by the first consuming end in advance.
The above apparatus, optionally, further comprises:
the triggering unit is used for triggering the second consuming terminal to judge whether the representation fed back by the target subscriber is received or not within a preset time period and successfully receive the feedback message of the message body, if the representation fed back by the target subscriber is received, the message body is deleted from the target message queue, if the representation is not received, the message body is obtained from the target message queue according to a preset period and is pushed to the target subscriber until the representation fed back by the target subscriber is received and the feedback message of the message body is successfully received; and the second consuming side is any one of the consuming sides monitoring the target message queue.
A storage medium, comprising stored instructions, wherein when executed, the instructions control a device on which the storage medium is located to execute the above message pushing method.
An electronic device comprising a memory, and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by one or more processors to perform the message pushing method described above.
Compared with the prior art, the method has the following advantages:
the application provides a message pushing method and a routing device, wherein the method comprises the following steps: responding to a message distribution request sent by a publisher, and acquiring a message body and a routing key included in the message distribution request; acquiring a pre-stored target message queue identifier corresponding to the routing key; writing the message body into a target message queue corresponding to the target message queue identification, triggering the first consumption end to acquire the message body from the target message queue, and pushing the message body to a target subscriber bound with the target message queue; the first consuming side is any one of the consuming sides of the monitoring target message queue. In the technical scheme provided by the application, because the corresponding relation between the routing key and the identifier of the message queue is stored in the routing device in advance, after the routing device receives the routing key sent by the publisher, the routing device can determine the identifier of the target message queue and write the message body into the target message queue corresponding to the identifier of the target message queue without storing a message pushing strategy in the publisher, so that under the condition of increasing the subscribers, the relevant codes of the publisher do not need to be modified, and the code development and maintenance cost is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method of pushing a message according to the present application;
fig. 2 is a flowchart of another method of a message pushing method provided in the present application;
fig. 3 is a flowchart of another method of a message pushing method provided in the present application;
fig. 4 is a schematic structural diagram of a routing device provided in the present application;
fig. 5 is a schematic structural diagram of a message pushing system provided in the present application;
fig. 6 is a schematic structural diagram of an electronic device provided in the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
An embodiment of the present application provides a message pushing method, where an execution subject of the method is a routing device, and a flowchart of the message pushing method is shown in fig. 1, and specifically includes:
s101, responding to a message pushing request sent by a publisher, and acquiring a message body and a routing key included in the message pushing request.
The publisher generates a message body, and generates a routing key corresponding to the message body according to a routing key generation rule based on the generated message body, wherein optionally, the format of the routing key can be' system. For example, when the user has registered a message, the corresponding routing key is: acc, user, registered; the user is authenticated, and the corresponding routing key is: acc, user, authed; the broker information has changed and the corresponding routing key is: Acc.agent.InfoUpdated; the consultant building is bound, and the corresponding routing key is as follows: acc, Consultant, ProjBingded.
And the router responds to the message pushing request sent by the publisher to acquire the message body and the routing key included in the message pushing request.
S102, obtaining a pre-stored target message queue identification corresponding to the route key.
The routing device pre-stores the corresponding relation between a plurality of routing keys and the message queue identifications, acquires the message queue identifications corresponding to the routing keys contained in the message pushing request based on the pre-stored corresponding relation between the routing keys and the message queue identifications, and determines the message queue identifications corresponding to the routing keys contained in the message pushing request as target message queue identifications.
Referring to fig. 2, the process of acquiring the pre-stored identifier corresponding to the target message corresponding to the routing key specifically includes:
s201, analyzing the routing key to obtain a first identifier and a second identifier contained in the routing key.
Analyzing the routing key, specifically, dividing the routing key into three character strings through a character ". quadrature.", forming a first identifier by a first character string and a second character string, separating the first identifier and the second identifier through the character ". quadrature.", and taking the last character as a second identifier.
S202, determining a pre-stored message queue identification set corresponding to the first identification.
Determining the corresponding relation between each routing key stored in advance and the message queue identifier, and taking the routing key in each corresponding relation stored in advance as a preset routing key; and matching the first identifier with each preset routing key, determining the preset routing key matched with the first identifier in each corresponding relation, and forming a message queue identifier set by using the message queue identifiers corresponding to the preset routing keys matched with the first identifier.
S203, determining the message queue identifier corresponding to the second identifier in the message queue identifier set as a target message queue identifier.
And matching a preset routing key corresponding to each message queue identifier in the message queue identifier set with the second identifier, and determining the message queue identifier corresponding to the routing key matched with the second identifier in the message queue identifier set as the target message queue identifier.
In the method provided by the embodiment of the application, the routing key is analyzed into the first identifier and the second identifier, so that the message queue identifier set is determined based on the first identifier, and the target message queue identifier is determined from the message queue identifier set based on the second identifier.
S103, writing the message body into a target message queue corresponding to the target message queue identification, triggering the first consuming end to acquire the message body from the target message queue, and pushing the message body to a target subscriber bound with the target message queue.
The routing device determines a message queue corresponding to the target message queue identification, determines a target message queue corresponding to the target message queue identification, writes the message body into the target message queue, so as to trigger the first consumption end to acquire the message body from the target message queue, and pushes the message body to a target subscriber bound with the target message queue.
In the method provided by the embodiment of the application, after the routing device writes the message body into the target message queue, each consumption end monitoring the target message queue competes with each other after monitoring that the message body is written into the target message queue, the consumption end passing the competition is taken as the first consumption end, and the first consumption end acquires the message body in the target message queue and sends the message body to the target subscriber.
It should be noted that the number of consumers listening to each message queue is determined by the number of consumers opened by the subscriber binding the message queue. Optionally, the message queue and the consuming side may be in a one-to-one relationship, or may be in a one-to-many relationship.
In the method provided by the embodiment of the present application, a process of a first consumer side pushing a message body to a target subscriber bound to a target message queue includes:
triggering the first consuming end to forward configuration information based on an interface, determining the interface information of a target subscriber binding the message queue, and pushing the message body to the interface corresponding to the interface information of the target subscriber, wherein the interface forwarding configuration information is acquired by the first consuming end in advance.
In the method provided by the embodiment of the application, the first consuming terminal obtains interface forwarding configuration information stored in advance, determines the interface information of the target subscriber bound with the target message queue based on the interface forwarding configuration information, and pushes the message body to the interface corresponding to the interface information, so that the message body is pushed to the target subscriber bound with the target message queue.
The method provided by the embodiment of the application further comprises the following steps:
triggering a second consumption end to judge whether the representation fed back by the target subscriber is received or not and successfully receive the feedback message of the message body within a preset time period, if so, deleting the message body from the target message queue, if not, acquiring the message body from the target message queue according to a preset period, and pushing the message body to the target subscriber until the representation fed back by the target subscriber is received and the feedback message of the message body is successfully received; and the second consuming side is any one of the consuming sides monitoring the target message queue.
In the method provided by the embodiment of the application, a second consuming side judges whether a feedback message indicating that the message body is successfully received is received within a preset time period, wherein the second consuming side is a consuming side which monitors competition among all consuming sides of a target message queue; and if the second consuming terminal judges that the feedback information of the message body which is fed back by the target subscriber and is represented by the successfully received message body is received within the preset time period, deleting the message body from the target message queue, and if the feedback information of the message body which is fed back by the target subscriber and is represented by the successfully received message body is judged within the preset time period, acquiring the message body from the target message queue according to a preset period and pushing the message body to the target subscriber until the feedback information of the message body which is fed back by the target subscriber and is represented by the successfully received message body is received.
The message pushing method provided by the embodiment of the application responds to a message distribution request sent by a publisher, and obtains a message body and a routing key included in the message distribution request; acquiring a pre-stored target message queue identifier corresponding to the routing key; writing the message body into a target message queue corresponding to the target message queue identification, triggering the first consumption end to acquire the message body from the target message queue, and pushing the message body to a target subscriber bound with the target message queue; the first consuming side is any one of the consuming sides of the monitoring target message queue. By applying the message pushing method provided by the embodiment of the application, because the corresponding relation between the routing key and the message queue identifier is stored in the routing device in advance, after the routing device receives the routing key sent by the publisher, the routing device can determine the target message queue identifier and write the message body into the target message queue corresponding to the target message queue identifier without storing a message pushing strategy in the publisher, so that under the condition of increasing the number of subscribers, the relevant codes of the publisher are not required to be modified, and the code development and maintenance cost is reduced.
As shown in fig. 3, the method provided in the foregoing embodiment of the present application may further include the following steps:
s301, monitoring the total amount of the message bodies in each message queue in real time.
The monitoring unit in the routing device monitors the total amount of the message bodies of each message queue in real time, that is, obtains the total amount of the message bodies contained in each message queue in real time, wherein the total amount of the message bodies in the message queues is used for indicating the number of the message bodies contained in the message queues.
S302, judging whether the total amount of the message bodies in each message queue is larger than a preset threshold value.
And aiming at each message queue, comparing the total message body amount of the message queue with a preset threshold value, and judging whether the total message body amount in the message queue is greater than the preset threshold value.
S303, alarming is carried out on the message queue with the total message body amount larger than the preset threshold value.
And for each message queue, if the total amount of the message bodies in the message queue is greater than a preset threshold value, alarming the message queue.
In the method provided by the embodiment of the application, the message queue with the total message body amount larger than the preset threshold value is alarmed, so that a worker is prompted to clear the message bodies in the message queue.
Corresponding to the method described in fig. 1, an embodiment of the present application further provides a routing apparatus, which is used for implementing the method in fig. 1 specifically, and a schematic structural diagram of the routing apparatus is shown in fig. 4, and specifically includes:
a first obtaining unit 401, configured to obtain, in response to a message push request sent by a publisher, a message body and a routing key included in the message push request;
a second obtaining unit 402, configured to obtain a pre-stored target message queue identifier corresponding to the routing key;
a writing unit 403, configured to write the message body into a target message queue corresponding to the target message queue identifier, trigger the first consuming end to obtain the message body from the target message queue, and push the message body to a target subscriber bound to the target message queue; the first consuming side is any one of the consuming sides monitoring the target message queue.
The message pushing device provided by the embodiment of the application responds to a message distribution request sent by a publisher, and obtains a message body and a routing key included in the message distribution request; acquiring a pre-stored target message queue identifier corresponding to the routing key; writing the message body into a target message queue corresponding to the target message queue identification, triggering the first consumption end to acquire the message body from the target message queue, and pushing the message body to a target subscriber bound with the target message queue; the first consuming side is any one of the consuming sides of the monitoring target message queue. By applying the routing device provided by the embodiment of the application, because the corresponding relation between the routing key and the message queue identifier is stored in the routing device in advance, after the routing device receives the routing key sent by the publisher, the routing device can determine the target message queue identifier, and writes the message body into the target message queue corresponding to the target message queue identifier without storing a message pushing strategy in the publisher, so that under the condition of increasing the number of subscribers, the relevant codes of the publisher are not required to be modified, and the code development and maintenance cost is reduced.
In an embodiment of the present application, based on the foregoing scheme, the second obtaining unit 402 performs obtaining of a pre-stored message queue identifier corresponding to the routing key, specifically to:
analyzing the routing key to obtain a first identifier and a second identifier contained in the routing key;
determining a pre-stored message queue identifier set corresponding to the first identifier; wherein, the message queue identification set comprises at least one message queue identification;
and determining the message queue identifier corresponding to the second identifier in the message queue identifier set as a target message queue identifier.
In an embodiment of the present application, based on the foregoing scheme, the method may further include:
the monitoring unit is used for monitoring the total amount of the message bodies in each message queue in real time;
the judging unit is used for judging whether the total amount of the message bodies in each message queue is greater than a preset threshold value or not;
and the alarm unit is used for alarming the message queue with the total message body amount larger than the preset threshold value.
In an embodiment of the present application, based on the foregoing scheme, the writing unit 403 executes a process of triggering the first consuming end to push the message body to a target subscriber bound to the target message queue, specifically configured to:
and triggering the first consuming end to forward configuration information based on an interface, determining the interface information of a target subscriber binding the target message queue, and pushing the message body to an interface corresponding to the interface information of the target subscriber, wherein the interface forwarding configuration information is acquired by the first consuming end in advance. In an embodiment of the present application, based on the foregoing scheme, the method may further include:
the triggering unit is used for triggering the second consuming terminal to judge whether the representation fed back by the target subscriber is received or not within a preset time period and successfully receive the feedback message of the message body, if the representation fed back by the target subscriber is received, the message body is deleted from the target message queue, if the representation is not received, the message body is obtained from the target message queue according to a preset period and is pushed to the target subscriber until the representation fed back by the target subscriber is received and the feedback message of the message body is successfully received; and the second consuming side is any one of the consuming sides monitoring the target message queue.
Optionally, an embodiment of the present application provides a message pushing system, as shown in fig. 5, specifically including: a publisher 501, a routing device 502, a consumer 503, and a subscriber 504.
The publisher 501 is configured to generate a message body and a routing key, and send a message push request to the routing device 502 based on the message body and the routing key;
a routing means 502 for executing the message pushing method as described above;
the consuming end 503 is configured to monitor whether a message body exists in the routing apparatus 502, and if the message body exists, obtain the message body and push the message body to the subscriber.
An embodiment of the present application further provides a storage medium, where the storage medium includes stored instructions, where when the instructions are executed, the apparatus where the storage medium is located is controlled to perform the following operations:
responding to a message pushing request sent by a publisher, and acquiring a message body and a routing key included in the message pushing request;
acquiring a pre-stored target message queue identifier corresponding to the routing key;
writing the message body into a target message queue corresponding to the target message queue identification, triggering a first consumption end to acquire the message body from the target message queue, and pushing the message body to a target subscriber bound with the target message queue; the first consuming side is any one of the consuming sides monitoring the target message queue.
The present embodiment further provides an electronic device, whose schematic structural diagram is shown in fig. 6, specifically including a memory 601, and one or more instructions 602, where the one or more instructions 602 are stored in the memory 601 and configured to be executed by one or more processors 603 to perform the following operations according to the one or more instructions 602:
responding to a message pushing request sent by a publisher, and acquiring a message body and a routing key included in the message pushing request;
acquiring a pre-stored target message queue identifier corresponding to the routing key;
writing the message body into a target message queue corresponding to the target message queue identification, triggering a first consumption end to acquire the message body from the target message queue, and pushing the message body to a target subscriber bound with the target message queue; the first consuming side is any one of the consuming sides monitoring the target message queue.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the system-class embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
For convenience of description, the above system is described as being divided into various units by functions, and described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
From the above description of the embodiments, it is clear to those skilled in the art that the present application can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present application may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments of the present application.
The above detailed description is given to a message pushing method and a routing device provided by the present application, and a specific example is applied in the present application to explain the principle and the implementation of the present application, and the description of the above embodiment is only used to help understand the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A message pushing method is applied to a routing device, and comprises the following steps:
responding to a message pushing request sent by a publisher, and acquiring a message body and a routing key included in the message pushing request;
acquiring a pre-stored target message queue identifier corresponding to the routing key;
writing the message body into a target message queue corresponding to the target message queue identification, triggering a first consumption end to acquire the message body from the target message queue, and pushing the message body to a target subscriber bound with the target message queue; the first consuming side is any one of the consuming sides monitoring the target message queue.
2. The method of claim 1, wherein the obtaining a pre-stored message queue identifier corresponding to the routing key comprises:
analyzing the routing key to obtain a first identifier and a second identifier contained in the routing key;
determining a pre-stored message queue identifier set corresponding to the first identifier; wherein, the message queue identification set comprises at least one message queue identification;
and determining the message queue identifier corresponding to the second identifier in the message queue identifier set as a target message queue identifier.
3. The method of claim 2, further comprising:
monitoring the total amount of message bodies in each message queue in real time;
judging whether the total amount of the message bodies in each message queue is greater than a preset threshold value or not;
and alarming the message queue with the total message body amount larger than a preset threshold value.
4. The method of claim 1, wherein the process of triggering the first consumer to push the message body to the target subscriber bound to the target message queue comprises:
and triggering the first consuming end to forward configuration information based on an interface, determining the interface information of a target subscriber binding the target message queue, and pushing the message body to an interface corresponding to the interface information of the target subscriber, wherein the interface forwarding configuration information is acquired by the first consuming end in advance.
5. The method of claim 1 or 4, further comprising:
triggering a second consumption end to judge whether the representation fed back by the target subscriber is received or not and successfully receive the feedback message of the message body within a preset time period, if so, deleting the message body from the target message queue, if not, acquiring the message body from the target message queue according to a preset period, and pushing the message body to the target subscriber until the representation fed back by the target subscriber is received and the feedback message of the message body is successfully received; and the second consuming side is any one of the consuming sides monitoring the target message queue.
6. A routing device, comprising:
the first obtaining unit is used for responding to a message pushing request sent by a publisher and obtaining a message body and a routing key included in the message pushing request;
the second acquisition unit is used for acquiring a pre-stored target message queue identifier corresponding to the routing key;
a writing unit, configured to write the message body into a target message queue corresponding to the target message queue identifier, trigger a first consuming end to obtain the message body from the target message queue, and push the message body to a target subscriber bound with the target message queue; the first consuming side is any one of the consuming sides monitoring the target message queue.
7. The apparatus according to claim 6, wherein the second obtaining unit is configured to obtain a pre-stored message queue identifier corresponding to the routing key, and is specifically configured to:
analyzing the routing key to obtain a first identifier and a second identifier contained in the routing key;
determining a pre-stored message queue identifier set corresponding to the first identifier; wherein, the message queue identification set comprises at least one message queue identification;
and determining the message queue identifier corresponding to the second identifier in the message queue identifier set as a target message queue identifier.
8. The apparatus of claim 7, further comprising:
the monitoring unit is used for monitoring the total amount of the message bodies in each message queue in real time;
the judging unit is used for judging whether the total amount of the message bodies in each message queue is greater than a preset threshold value or not;
and the alarm unit is used for alarming the message queue with the total message body amount larger than the preset threshold value.
9. The apparatus according to claim 6, wherein the write unit performs a process that triggers the first consumer to push the message body to a target subscriber bound to the target message queue, and is specifically configured to:
and triggering the first consuming end to forward configuration information based on an interface, determining the interface information of a target subscriber binding the target message queue, and pushing the message body to an interface corresponding to the interface information of the target subscriber, wherein the interface forwarding configuration information is acquired by the first consuming end in advance.
10. The apparatus of claim 6 or 9, further comprising:
the triggering unit is used for triggering the second consuming terminal to judge whether the representation fed back by the target subscriber is received or not within a preset time period and successfully receive the feedback message of the message body, if the representation fed back by the target subscriber is received, the message body is deleted from the target message queue, if the representation is not received, the message body is obtained from the target message queue according to a preset period and is pushed to the target subscriber until the representation fed back by the target subscriber is received and the feedback message of the message body is successfully received; and the second consuming side is any one of the consuming sides monitoring the target message queue.
CN202011509424.2A 2020-12-18 2020-12-18 Message pushing method and routing device Pending CN112637046A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011509424.2A CN112637046A (en) 2020-12-18 2020-12-18 Message pushing method and routing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011509424.2A CN112637046A (en) 2020-12-18 2020-12-18 Message pushing method and routing device

Publications (1)

Publication Number Publication Date
CN112637046A true CN112637046A (en) 2021-04-09

Family

ID=75317475

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011509424.2A Pending CN112637046A (en) 2020-12-18 2020-12-18 Message pushing method and routing device

Country Status (1)

Country Link
CN (1) CN112637046A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113448725A (en) * 2021-05-27 2021-09-28 深圳震有科技股份有限公司 Data pushing method, device, terminal and storage medium
CN114168288A (en) * 2021-12-07 2022-03-11 北京数码大方科技股份有限公司 Work order task execution method and device, storage medium and processor

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105227662A (en) * 2015-09-30 2016-01-06 努比亚技术有限公司 Message treatment method, device and system
CN107528818A (en) * 2016-09-27 2017-12-29 腾讯科技(北京)有限公司 The data processing method and device of media file
US20180063055A1 (en) * 2016-08-26 2018-03-01 Linkedin Corporation Repartitioning a topic in a publish-subscribe message system
CN108769099A (en) * 2018-04-02 2018-11-06 武汉斗鱼网络科技有限公司 A kind of implementation method of the message duplicate removal of message-oriented middleware
CN109361770A (en) * 2018-12-11 2019-02-19 苏州创旅天下信息技术有限公司 The system and method for bidirectional real-time is realized based on WebSocket and message queue
CN109885410A (en) * 2019-01-09 2019-06-14 广州视源电子科技股份有限公司 Message sending method, device, computer equipment and storage medium
CN111327696A (en) * 2020-02-17 2020-06-23 北京奇艺世纪科技有限公司 Data processing method and system
CN111800354A (en) * 2019-04-08 2020-10-20 中移(苏州)软件技术有限公司 Message processing method and device, message processing equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105227662A (en) * 2015-09-30 2016-01-06 努比亚技术有限公司 Message treatment method, device and system
US20180063055A1 (en) * 2016-08-26 2018-03-01 Linkedin Corporation Repartitioning a topic in a publish-subscribe message system
CN107528818A (en) * 2016-09-27 2017-12-29 腾讯科技(北京)有限公司 The data processing method and device of media file
CN108769099A (en) * 2018-04-02 2018-11-06 武汉斗鱼网络科技有限公司 A kind of implementation method of the message duplicate removal of message-oriented middleware
CN109361770A (en) * 2018-12-11 2019-02-19 苏州创旅天下信息技术有限公司 The system and method for bidirectional real-time is realized based on WebSocket and message queue
CN109885410A (en) * 2019-01-09 2019-06-14 广州视源电子科技股份有限公司 Message sending method, device, computer equipment and storage medium
CN111800354A (en) * 2019-04-08 2020-10-20 中移(苏州)软件技术有限公司 Message processing method and device, message processing equipment and storage medium
CN111327696A (en) * 2020-02-17 2020-06-23 北京奇艺世纪科技有限公司 Data processing method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113448725A (en) * 2021-05-27 2021-09-28 深圳震有科技股份有限公司 Data pushing method, device, terminal and storage medium
CN114168288A (en) * 2021-12-07 2022-03-11 北京数码大方科技股份有限公司 Work order task execution method and device, storage medium and processor

Similar Documents

Publication Publication Date Title
CN107733662B (en) Group recovery method and device
CN104834602B (en) A kind of program dissemination method, device and program delivery system
CN109543891B (en) Method and apparatus for establishing capacity prediction model, and computer-readable storage medium
CN112637046A (en) Message pushing method and routing device
CN108733358A (en) Spark-based machine learning workflow construction method and device
CN115378713B (en) Block chain application early warning defense method, storage medium and electronic equipment
CN113157315A (en) Method, device, equipment and medium for identifying difference information of different versions of software
CN111367531B (en) Code processing method and device
CN110333851B (en) Code decoupling method and related equipment
CN116523457A (en) Workflow processing method, device, equipment and storage medium based on business process
US8751560B2 (en) Method and device arrangement for managing a client/server environment
CN113312885B (en) Cooperative operation processing method, device, equipment and medium
CN107633080B (en) User task processing method and device
CN112948804B (en) Program control method, device and computer readable storage medium
CN113590308A (en) Workflow processing method, device, equipment and medium for applying for cloud resources
CN112365267A (en) Operation behavior-based crawler-resisting method and device
CN114584627B (en) Middle station dispatching system and method with network monitoring function
CN110515743B (en) Write event notification method and device
CN113868531A (en) Information acquisition method and device, electronic device and medium
CN114968276A (en) Application program deployment method and device, computer equipment and storage medium
CN113485731A (en) Intelligent contract upgrading method and system for block chain
JP6311329B2 (en) Information processing apparatus, monitoring method, and program
CN115018509A (en) Object processing method and device, electronic equipment and storage medium
CN113672281A (en) Code difference query method, device, equipment and storage medium
CN106453441B (en) A kind of communication preprocess method and management system

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210409

RJ01 Rejection of invention patent application after publication