Search

CN-122001754-A - Node configuration method and device, electronic equipment and storage medium

CN122001754ACN 122001754 ACN122001754 ACN 122001754ACN-122001754-A

Abstract

The embodiment of the application provides a node configuration method and device, electronic equipment and a storage medium, and belongs to the field of system operation and maintenance. The method is applied to a message distribution system and comprises the steps of receiving a node access request of a node to be configured, requesting the node access request to access the message distribution system, responding to the node access request, configuring a message sending component and a message consumption component aiming at the node to be configured, wherein the message sending component is used for sending a target message received by the message distribution system to a message middleware, the target message is a message sent to the node to be configured, and the message consumption component is used for obtaining the target message from the message middleware and sending the target message to the node to be configured. The message distribution system can dynamically configure new nodes according to the requirements by configuring new and independent containerization components without carrying out hardware upgrade on the whole server containing the message distribution system, so that the expansibility of the message distribution system is enhanced.

Inventors

  • WU RONGXIN
  • ZHAO YONGJIANG
  • WU MIN
  • LIU SIJIE
  • SUN JUNYI
  • YANG JINHAI
  • ZHAO MINGCHENG
  • LI QING
  • DAI WEIPING
  • ZHANG YAO
  • LI WENZHI

Assignees

  • 顺丰科技有限公司

Dates

Publication Date
20260508
Application Date
20241105

Claims (10)

  1. 1. A node configuration method, applied to a message distribution system, the method comprising: Receiving a node access request of a node to be configured, wherein the node access request is used for requesting to access the message distribution system; Responding to the node access request, and configuring a message sending component and a message consuming component aiming at the node to be configured; The message sending component is used for sending the target message received by the message distribution system to the message middleware, wherein the target message is a message sent to the node to be configured; the message consumption component is used for acquiring the target message from the message middleware and sending the target message to the node to be configured.
  2. 2. The method of claim 1, wherein after configuring a messaging component and a message consuming component for the node to be configured, the method further comprises: receiving a first message sent by a first node; and under the condition that the first message is determined to be the target message of the node to be configured according to the message configuration information carried in the node access request, the first message is sent to the message middleware through the message sending component.
  3. 3. The method of claim 2, wherein the first message comprises an identification of the first node, wherein the message configuration information comprises an identification of a node that sent the target message, and wherein the message type of the target message; the determining that the first message is the target message of the node to be configured according to the message configuration information carried in the node access request includes at least one of the following: if the identification of the first node is matched with the identification of the node sending the target message, determining that the first message is the target message of the node to be configured; And if the message type of the first message is matched with the message type of the target message, determining that the first message is the target message of the node to be configured.
  4. 4. The method of claim 2, wherein the message configuration information includes a preset field of the target message; The sending, by the message sending component, the first message to the message middleware when determining that the first message is the target message of the node to be configured according to the message configuration information carried in the node access request includes: Under the condition that the first message is determined to be the target message of the node to be configured according to the message configuration information carried in the node access request, screening the field of the first message according to the preset field to obtain a second message, wherein the second message comprises the content of the preset field in the first message; and sending the second message to the message middleware through the message sending component.
  5. 5. The method of claim 2, wherein after the sending of the first message to the message middleware by the messaging component, the method further comprises: Acquiring a sending result of the first message through the message middleware, wherein the sending result is used for indicating whether the first message is successfully sent to the message middleware; And if the sending result indicates that the first message is not successfully sent to the message middleware, the message sending component is used for sending the first message to the message middleware again.
  6. 6. The method of claim 5, wherein, in the case where the transmission result indicates that the first message was not successfully transmitted to the message middleware, transmitting the first message to the message middleware again using the message transmitting component comprises: Acquiring the sending times of the message sending component for sending the first message to the message middleware under the condition that the sending result indicates that the first message is not successfully sent to the message middleware; When the sending times are smaller than a preset times threshold value, the message sending component is used for sending the first message to the message middleware again; Adding the first message to a dead message queue under the condition that the sending times are greater than or equal to the preset times threshold; And analyzing the reason of the transmission failure of the first message in the dead letter queue, and determining the reason of the transmission failure.
  7. 7. The method of claim 1, wherein after said configuring a messaging component and a message consuming component for said node to be configured, the method further comprises: storing the identification of the node to be configured, and the corresponding relation between the identification of the message sending component and the identification of the message consuming component to a database; and determining the working states of the message sending component and the message consuming component according to the corresponding relation in the database so as to determine whether the node to be configured is accessed to the message distribution system.
  8. 8. A node configuration apparatus for use in a message distribution system, the apparatus comprising: The receiving module is used for receiving a node access request of a node to be configured, wherein the node access request is used for requesting to access the message distribution system; The creation module is used for responding to the node access request and configuring a message sending component and a message consumption component aiming at the node to be configured; The message sending component is used for sending the target message received by the message distribution system to the message middleware, wherein the target message is a message sent to the node to be configured; the message consumption component is used for acquiring the target message from the message middleware and sending the target message to the node to be configured.
  9. 9. An electronic device comprising a memory storing a computer program and a processor implementing the node configuration method of any of claims 1 to 7 when the computer program is executed by the processor.
  10. 10. A computer readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, implements the node configuration method of any one of claims 1 to 7.

Description

Node configuration method and device, electronic equipment and storage medium Technical Field The present application relates to the field of system operation and maintenance, and in particular, to a node configuration method and apparatus, an electronic device, and a storage medium. Background Currently, with the development of distributed systems and big data processing technologies, more and more user service systems employ browser and server architectures, or client and server architectures. And the user sends a service request to the server through the terminal equipment with the browser or the client, and the message distribution system in the server pushes the message required by the user to the terminal equipment of the user. In practical applications, a message distribution system needs to process a large number of messages, however, in the related art, when the system needs to process more messages to access more nodes, complex hardware upgrades are required to be performed on the entire server including the message distribution system to achieve node access, that is, the current message distribution system has poor expansibility. Disclosure of Invention The embodiment of the application mainly aims to provide a node configuration method and device, electronic equipment and a storage medium, and aims to improve the expansibility of a message distribution system. To achieve the above object, a first aspect of an embodiment of the present application provides a node configuration method, which is applied to a message distribution system, and the method includes: Receiving a node access request of a node to be configured, wherein the node access request is used for requesting to access the message distribution system; Responding to the node access request, and configuring a message sending component and a message consuming component aiming at the node to be configured; The message sending component is used for sending the target message received by the message distribution system to the message middleware, wherein the target message is a message sent to the node to be configured; the message consumption component is used for acquiring the target message from the message middleware and sending the target message to the node to be configured. In some embodiments, after configuring the message sending component and the message consuming component for the node to be configured, the method further comprises: receiving a first message sent by a first node; and under the condition that the first message is determined to be the target message of the node to be configured according to the message configuration information carried in the node access request, the first message is sent to the message middleware through the message sending component. In some embodiments, the first message includes an identification of the first node, the message configuration information includes an identification of a node that sent the target message, and a message type of the target message; the determining that the first message is the target message of the node to be configured according to the message configuration information carried in the node access request includes at least one of the following: if the identification of the first node is matched with the identification of the node sending the target message, determining that the first message is the target message of the node to be configured; And if the message type of the first message is matched with the message type of the target message, determining that the first message is the target message of the node to be configured. In some embodiments, the message configuration information includes a preset field of the target message; The sending, by the message sending component, the first message to the message middleware when determining that the first message is the target message of the node to be configured according to the message configuration information carried in the node access request includes: Under the condition that the first message is determined to be the target message of the node to be configured according to the message configuration information carried in the node access request, screening the field of the first message according to the preset field to obtain a second message, wherein the second message comprises the content of the preset field in the first message; and sending the second message to the message middleware through the message sending component. In some embodiments, after the sending of the first message to the message middleware by the messaging component, the method further comprises: Acquiring a sending result of the first message through the message middleware, wherein the sending result is used for indicating whether the first message is successfully sent to the message middleware; And if the sending result indicates that the first message is not successfully sent to the message middleware, the message sending component is used fo