CN108933824A - A kind of method, system and relevant apparatus keeping RabbitMQ service - Google Patents

A kind of method, system and relevant apparatus keeping RabbitMQ service Download PDF

Info

Publication number
CN108933824A
CN108933824A CN201810689441.5A CN201810689441A CN108933824A CN 108933824 A CN108933824 A CN 108933824A CN 201810689441 A CN201810689441 A CN 201810689441A CN 108933824 A CN108933824 A CN 108933824A
Authority
CN
China
Prior art keywords
node
rabbitmq
service providing
available
information
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
CN201810689441.5A
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.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201810689441.5A priority Critical patent/CN108933824A/en
Publication of CN108933824A publication Critical patent/CN108933824A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • H04L67/1048Departure or maintenance mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • H04L67/1046Joining mechanisms

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

This application discloses a kind of methods of holding RabbitMQ service, this method obtains all RabbitMQ service providing nodes in available mode in cluster in advance, and establish obtain include each available RabbitMQ service providing node available section point set, when disconnecting between former RabbitMQ service providing node, optional one is concentrated to be used as replacement node from the enabled node, and the connection by establishing between the replacement node keeps RabbitMQ service not interrupt, and can be obviously improved the offer quality of RabbitMQ service and the high availability of cluster.The application further simultaneously discloses system, device and the computer readable storage medium of a kind of holding RabbitMQ service, has above-mentioned beneficial effect.

Description

A kind of method, system and relevant apparatus keeping RabbitMQ service
Technical field
This application involves RabbitMQ service technology field, in particular to a kind of method for keeping RabbitMQ service is System, device and computer readable storage medium.
Background technique
Current RabbitMQ client is towards single RabbitMQ server design, as service provides range Expand, can dispose RabbitMQ server cluster now to improve the availability of RabbitMQ service, RabbitMQ visitor Family end, which is connected to any one server in cluster, can send and receive message.Wherein, RabbitMQ is one in AMQP Enterprise messaging system completed on the basis of agreement, reusable, wherein MQ (Message Queue, message queue) is a kind of Communication means of the application program to application program.
But since each RabbitMQ client is all to be in the early stage towards single RabbitMQ server design The RabbitMQ server that every RabbitMQ client distribution is fixedly connected (has continued to use original only one individually Mode when RabbitMQ server), so if being connected to the institute of this server when a server delay machine in cluster There is RabbitMQ client that can all disconnect, and originally established all of connection with the RabbitMQ server of this delay machine RabbitMQ client is not due to considering in the RabbitMQ server cluster for upgrading to multiple RabbitMQ servers compositions When replacement situation, the RabbitMQ client for causing these to disconnect cannot continue to RabbitMQ server set mass-send Message is sent and received, results in the High Availabitity characteristic of cluster that can not give full play in this way.
Although i.e. RabbitMQ server cluster provides the service of High Availabitity, every RabbitMQ client is still Fixed connection only is established with one of RabbitMQ server, is still occurred and original one once there is single node failure The case where RabbitMQ service disruption of sample.
Therefore, how to overcome items technological deficiency existing for existing holding RabbitMQ service mechanism, provide one kind in original It can re-establish and connect to protect with other available RabbitMQ servers automatically when disconnecting between RabbitMQ server Holding RabbitMQ and servicing unbroken mechanism is those skilled in the art's urgent problem to be solved.
Summary of the invention
The purpose of the application is to provide a kind of method of holding RabbitMQ service, and all be in can in acquisition cluster in advance With the RabbitMQ service providing node of state, and establish obtain include each available RabbitMQ service providing node available section Point set, when disconnecting between former RabbitMQ service providing node, from the enabled node concentrate optional one as replacing Node is changed, and the connection by establishing between the replacement node keeps RabbitMQ service not interrupt, and can be obviously improved The offer quality of RabbitMQ service and the high availability of cluster.
The another object of the application is the provision of a kind of system of holding RabbitMQ service, device and computer-readable Storage medium.
To achieve the above object, the application provides a kind of method of holding RabbitMQ service, comprising:
Receive the information returned from the former RabbitMQ service providing node that connection has been established;
Judge to receive whether the duration of the information is more than preset duration away from the last time;
The available of any non-original RabbitMQ service providing node is selected if so, concentrating from enabled node RabbitMQ service providing node establishes connection with the replacement node as replacement node to keep RabbitMQ to service; Wherein, it includes the node identity information of all available RabbitMQ service providing nodes and company in cluster that the enabled node, which is concentrated, It connects and establishes information, and the available section point set is pre-stored within RabbitMQ client local.
Optionally, the generating process of the available section point set includes:
Obtain each respective available mode information of RabbitMQ service providing node in the cluster;
It is determined according to each available mode information and belongs to the RabbitMQ that can use RabbitMQ service providing node Service providing node;
Institute is generated according to each information that can be established with the node identity information of RabbitMQ service providing node and connection State available section point set.
Optionally, the available of any non-original RabbitMQ service providing node of selection is being concentrated from enabled node Before RabbitMQ service providing node is as replacement node, further includes:
Disconnecting label is added for the original RabbitMQ service providing node;
It is corresponding, it is concentrated from enabled node and selects the available of any non-original RabbitMQ service providing node RabbitMQ service providing node is as replacement node specifically:
Any available RabbitMQ service for not being attached with the disconnecting label is selected to mention from the available section point set For node as replacement node.
Optionally, letter is being established according to each node identity information with RabbitMQ service providing node and connection Breath generates after the available section point set, further includes:
The enabled node is concentrated each available RabbitMQ service providing node for including carry out by predetermined order rule Sequence, obtains node sequencing table.
Optionally, select any available RabbitMQ service providing node as standby node, packet from enabled node concentration It includes:
The available RabbitMQ service offer for being located at top in the node sequencing table is provided by top-down sequence Node is as the standby node.
Optionally, this method further include:
It obtains to be serviced with RabbitMQ described in the cluster in each predetermined period by predetermined period and section is provided The change information of point;
The available section point set is updated using the information converting.
To achieve the above object, present invention also provides a kind of systems of holding RabbitMQ service, comprising:
Information receiving unit, for receiving the information returned from the former RabbitMQ service providing node that connection has been established;
Disconnecting judging unit, when for judging whether receive the duration of the information away from the last time is more than default It is long;
Node selection and service holding unit are replaced, is used for when the duration is more than the preset duration, from available section Point, which is concentrated, selects the available RabbitMQ service providing node of any non-original RabbitMQ service providing node as replacement Node, and connection is established with the replacement node to keep RabbitMQ to service;Wherein, it includes cluster that the enabled node, which is concentrated, In all available RabbitMQ service providing nodes node identity information and connection establish information, and the available section point set is pre- It is local to be first stored in RabbitMQ client.
Optionally, the system further include:
Available mode information acquisition unit, can for obtaining in the cluster that each RabbitMQ service providing node is respective Use status information;
RabbitMQ service providing node determination unit can be used, for belonging to institute according to each available mode information determination State the RabbitMQ service providing node of available RabbitMQ service providing node;
Available section point set generation unit, for being believed according to each node identities with RabbitMQ service providing node Breath and connection establish information and generate the available section point set.
Optionally, the system further include:
Disconnecting marks extra cell, for adding disconnecting mark for the original RabbitMQ service providing node Note;
It is corresponding, the replacement node selection and service holding unit specifically:
Any available RabbitMQ service for not being attached with the disconnecting label is selected to mention from the available section point set For node as replacement node.
Optionally, the system further include:
Node sequencing table generation unit, for the enabled node to be concentrated to include each available by predetermined order rule RabbitMQ service providing node is ranked up, and obtains node sequencing table.
Optionally, the replacement node selection and service holding unit include:
Sequence choose subelement, for by top-down sequence choose be located at the node sequencing table in top can Use RabbitMQ service providing node as the standby node.
Optionally, the system further include:
Cyclically-varying information acquisition unit, for being obtained in each predetermined period in the cluster by predetermined period The change information with RabbitMQ service providing node;
Change information period updating unit, for updating the available section point set using the information converting.
To achieve the above object, present invention also provides a kind of device of holding RabbitMQ service, which includes:
Memory, for storing computer program;
Processor realizes the holding RabbitMQ service as described in above content when for executing the computer program Method the step of.
To achieve the above object, described computer-readable to deposit present invention also provides a kind of computer readable storage medium It is stored with computer program on storage media, the guarantor as described in above content is realized when the computer program is executed by processor The step of holding the method for RabbitMQ service.
A kind of method of holding RabbitMQ service provided herein: it receives from the former RabbitMQ that connection has been established The information that service providing node returns;Judge to receive whether the duration of information is more than preset duration away from the last time;If so, from Enabled node concentration selects the available RabbitMQ service providing node of any non-original RabbitMQ service providing node as replacing Node is changed, and establishes connection with replacement node to keep RabbitMQ to service.
Obviously, this method passes through obtains all RabbitMQ service providing nodes in available mode in cluster in advance, And establish obtain include each available RabbitMQ service providing node available section point set, with former RabbitMQ service offer section When disconnecting between point, optional one is concentrated as replacement node, and by establishing and the replacement node from the enabled node Between connection keep RabbitMQ service do not interrupt, can be obviously improved RabbitMQ service offer quality and cluster High Availabitity Property.The application additionally provides system, device and the computer readable storage medium of a kind of holding RabbitMQ service simultaneously, has Above-mentioned beneficial effect, details are not described herein.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this The embodiment of application for those of ordinary skill in the art without creative efforts, can also basis The attached drawing of offer obtains other attached drawings.
Fig. 1 is a kind of flow chart of method for keeping RabbitMQ service provided by the embodiments of the present application;
Fig. 2 is the flow chart of another method for keeping RabbitMQ service provided by the embodiments of the present application;
Fig. 3 is a kind of schematic diagram for choosing first available RabbitMQ service providing node provided by the embodiments of the present application;
Fig. 4 is provided by the embodiments of the present application a kind of in the former connection disconnection that can be used between RabbitMQ service providing node Shi Zidong carries out the schematic diagram that connection is established with other available RabbitMQ service providing nodes;
Fig. 5 is a kind of mechanism block diagram of system for keeping RabbitMQ service provided by the embodiments of the present application.
Specific embodiment
The core of the application is to provide a kind of method of holding RabbitMQ service, and this method by obtaining in cluster in advance All RabbitMQ service providing nodes in available mode, and establish and obtain including that each available RabbitMQ service provides section The available section point set of point when disconnecting between former RabbitMQ service providing node, is concentrated optional from the enabled node One does not interrupt as replacement node, and by establishing the connection holding RabbitMQ service between the replacement node, can be significant The offer quality of RabbitMQ service and the high availability of cluster are provided.Another core of the application is to provide a kind of holding System, device and the computer readable storage medium of RabbitMQ service, have above-mentioned beneficial effect.
To keep the purposes, technical schemes and advantages of the embodiment of the present application clearer, below in conjunction with the embodiment of the present application In attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is Some embodiments of the present application, instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the art All other embodiment obtained without making creative work, shall fall in the protection scope of this application.
Embodiment one
Below in conjunction with Fig. 1, Fig. 1 is a kind of process of method for keeping RabbitMQ service provided by the embodiments of the present application Figure, specifically includes the following steps:
S101: the information returned from the former RabbitMQ service providing node that connection has been established is received;
S102: judge to receive whether the duration of information is more than preset duration away from the last time;
S101, S102, which are intended to service by RabbitMQ client from the former RabbitMQ that connection previously had been established, provides section The duration that return information is received at point judges whether to disconnect with original RabbitMQ service providing node, because even There is no data transmission, has a heartbeat packet for keep-alive usually to exclude to judge by accident yet.It may also directly be touched by bottom event Hair, such as the connection disconnected event etc. returned back by socket protocol (socket), those skilled in the art can be by more Kind of existing way be able to judge to connect whether terminal, and this part is not the emphasis that this case is studied, and details are not described herein.
S103: the available RabbitMQ service for selecting any non-original RabbitMQ service providing node is concentrated from enabled node Node is provided as replacement node, and establishes connection with replacement node to keep RabbitMQ to service.
Wherein, enabled node concentrates the node identity information including all available RabbitMQ service providing nodes in cluster Information is established with connection, and available section point set is pre-stored within RabbitMQ client local.
The application, which is directed to, to be continued to use originally in existing centralization RabbitMQ server cluster as every RabbitMQ client When the design of fixed RabbitMQ server is arranged, if the RabbitMQ server once causes broken string will lead to because abnormal The RabbitMQ client connecting with the RabbitMQ server is unable to maintain that the defect of normal RabbitMQ service, it is intended to logical The nodal information for preserving all RabbitMQ service providing nodes in available mode is supplied to respectively after in advance RabbitMQ client, so that connection of each RabbitMQ client between former RabbitMQ service providing node can when disconnecting Using optional one available RabbitMQ service providing node as replacement node, and by establishing connection with the replacement node to protect Hold RabbitMQ service not long disruption.
If the connection between RabbitMQ client and the replacement node is interrupted again, can be selected according to identical selection mode Another available RabbitMQ service providing node is selected as new replacement node, and so on, until owning in cluster RabbitMQ service providing node is unavailable, for the RabbitMQ service for being in the state of going offline for guaranteeing not wrong choice Node is provided, can also be its additional mark that goes offline in disconnecting therebetween, which is similarly positioned in difference The other available RabbitMQ service providing nodes concentrated are rejected it is of course also possible to directly concentrate it from the enabled node, are examined Consider going offline for some RabbitMQ service providing nodes and is likely to be temporary, it can also be each available using queue arrangement When RabbitMQ service providing node, it is moved to rear of queue, is moved out again after repeatedly attempting a connection to fail The available section point set.
Specifically, how from record to have can be used for all RabbitMQ service providing nodes in available mode in cluster Node concentrates one RabbitMQ service providing node of selection every time, and mode is varied, can be in no other influence factors In the presence of random one RabbitMQ service providing node of therefrom selection, will respectively can also may be used in a certain order Be ranked up with RabbitMQ service providing node, and follow certain selection principle from the sequencing table obtained by sequence according to It is secondary to select each available RabbitMQ service providing node.
Further, the mode for how obtaining and generating the available section point set is varied, it is usually required mainly in acquisition cluster The available mode information of each RabbitMQ service providing node, other information or manifestation mode can be according to the needs of actual conditions Flexibly addition and selection.
Further, the available mode information for forming each RabbitMQ service providing node of cluster will be sent out at any time Raw unknown transformation, therefore can also regularly update available section point set and be created as power to increase, one of which include but unlimited In implementation are as follows:
The change information that can use RabbitMQ service providing node in each predetermined period in cluster is obtained by predetermined period; Available section point set is updated using information converting.
Based on the above-mentioned technical proposal, a kind of method keeping RabbitMQ service provided by the embodiments of the present application, this method It obtains including each available by obtaining all RabbitMQ service providing nodes in available mode in cluster in advance, and establishing The available section point set of RabbitMQ service providing node, when disconnecting between former RabbitMQ service providing node, from The enabled node concentrates optional one to keep RabbitMQ as replacement node, and by foundation and the connection between the replacement node Service is not interrupted, and the offer quality of RabbitMQ service and the high availability of cluster can be obviously improved.
Embodiment two
Below in conjunction with Fig. 2, Fig. 2 is the process of another method for keeping RabbitMQ service provided by the embodiments of the present application Figure, the present embodiment on the basis of example 1, give a kind of method for how generating available section point set and a kind of label The RabbitMQ service providing node for interrupting connection status has been in distinguish other available RabbitMQ service providing nodes Method, specific implementation step is as follows:
S201: each respective available mode information of RabbitMQ service providing node in cluster is obtained;
S202: determine that the RabbitMQ for belonging to available RabbitMQ service providing node is serviced according to each available mode information Node is provided;
S203: establishing information generation according to the node identity information of each available RabbitMQ service providing node and connection can With node collection;
S201, S202 and S203 give a kind of method for generating available section point set, i.e. acquisition available mode information simultaneously RabbitMQ service providing node can be used according to the available mode information determination, and establishes and provides section comprising each RabbitMQ service The node identity information and connection of point establish the available section point set of information.
Wherein, node identity information is the information for identifying different RabbitMQ service providing nodes, connection establish information and Information (example needed for a RabbitMQ service providing node keeps RabbitMQ service is connected to for RabbitMQ client Such as IP address, MAC Address).
S204: it after disconnecting between former RabbitMQ service providing node, is provided for original RabbitMQ service Node adds disconnecting label;
On the basis of obtaining duration more than preset duration after one S102 of embodiment judgement, i.e., the premise of this step is established According to the description in S102, connection relationship originally can will be successfully established with a RabbitMQ client and RabbitMQ clothes are provided The former RabbitMQ service providing node of business is judged to going offline or lost contact, i.e. the connection between former RabbitMQ service providing node It interrupts.
S205: any available RabbitMQ service offer section for not being attached with disconnecting and marking is selected from available section point set Point is as replacement node;
S204 provides a kind of for the additional connection terminal mark of RabbitMQ service providing node in the connection SOT state of termination The method of note, S205 then can exclude a possibility that mistake selects RabbitMQ service providing node based on this.
S206: connection is established to keep RabbitMQ to service with replacement node.
It, can also be in the node body according to each available RabbitMQ service providing node in another embodiment of the application Part information and connection are established after information generation available section point set:
Each available RabbitMQ service providing node for including is concentrated to be ranked up enabled node by predetermined order rule, Obtain node sequencing table;
It is corresponding, in the step of choosing standby node:
The available RabbitMQ service providing node for being located at top in node sequencing table is chosen by top-down sequence As standby node.
Certainly it other sequences can also be followed is chosen in node sequencing table and obtain the standby node, those skilled in the art Under the guidance of this thought, a variety of specific implementations can be obtained, details are not described herein.
Embodiment three
Fig. 3 and Fig. 4 are referred to, Fig. 3 is that a kind of first available RabbitMQ service of selection provided by the embodiments of the present application mentions For the schematic diagram of node;Fig. 4 is provided by the embodiments of the present application a kind of between original can be with RabbitMQ service providing node Automatically the schematic diagram that connection is established with other available RabbitMQ service providing nodes is carried out when connection disconnects, the present embodiment combines Concrete application scene gives a kind of specific implementation:
Each RabbitMQ client has recorded the IP address of all available RabbitMQ service providing nodes in cluster, And form an IP address pond.It is serviced whenever RabbitMQ client will establish connection with RabbitMQ cluster using RabbitMQ When, just one IP address of selection is attached in random secondary IP address pond, is caused when due to network cause or server delay machine When RabbitMQ service providing node corresponding with the IP address disconnects, which can automatic secondary IP address The IP address that another available RabbitMQ server is randomly choosed in pond is attached, and the process that this connection restores is to making User is transparent.Mechanism mechanism is kept by this connection, one can be provided to user (upper-layer service) reliably RabbitMQ connection.
Specific implementation process is as follows:
RabbitMQ client initialization simultaneously connects RabbitMQ server cluster, refers to Fig. 3:
(1) server ip address list (or being passed to by user/upper-layer service) is obtained;
(2) IP address sequence is upset and (is conducive to the load balancing between multiple server nodes);
(3) using out-of-order server ip address list as IP address pond;
(4) successively IP is taken to be attached from the pond IP, until successful connection;
(5) the IP serial number of successful connection is recorded.
After detecting that connection disconnects, RabbitMQ client reconnection is mainly included the following steps that, refers to Fig. 4:
(1) next IP (if without next IP again since first serial number) is selected according to serial number;
(2) it is initiated the connection to the IP, if unsuccessfully going to (1) step.
The IP of all available RabbitMQ service providing nodes of RabbitMQ server cluster is saved in by the present embodiment In the IP address pond of each RabbitMQ client, serviced whenever a RabbitMQ client is detected with current RabbitMQ After providing the connection disconnection between node, with regard to selecting a spare RabbitMQ service providing node to connect again in secondary IP address pond It connects, the availability of RabbitMQ client connection and the continuity of business is guaranteed with this.
Because situation is complicated, it can not enumerate and be illustrated, those skilled in the art should be able to recognize according to the application The basic skills principle combination actual conditions of offer may exist many examples, in the case where not paying enough creative works, It should within the scope of protection of this application.
Fig. 5 is referred to below, and Fig. 5 is a kind of structure of system for keeping RabbitMQ service provided by the embodiments of the present application Block diagram, the system may include:
Information receiving unit 100, for receiving the letter returned from the former RabbitMQ service providing node that connection has been established Breath;
Disconnecting judging unit 200 receives whether the duration of information is more than preset duration away from the last time for judging;
Node selection and service holding unit 300 are replaced, for being concentrated from enabled node when duration is more than preset duration Select the available RabbitMQ service providing node of any non-original RabbitMQ service providing node as replacement node, and with replace It changes node and establishes connection to keep RabbitMQ to service;Wherein, it includes all available RabbitMQ in cluster that enabled node, which is concentrated, Information is established in the node identity information of service providing node and connection, and available section point set is pre-stored within RabbitMQ client It is local.
Further, the system of holding RabbitMQ service can also include:
Available mode information acquisition unit, for obtaining each respective available shape of RabbitMQ service providing node in cluster State information;
RabbitMQ service providing node determination unit can be used, it is available for being belonged to according to the determination of each available mode information The RabbitMQ service providing node of RabbitMQ service providing node;
Available section point set generation unit, for according to the node identity information of each available RabbitMQ service providing node and Connection establishes information and generates available section point set.
Further, the system of holding RabbitMQ service can also include:
Disconnecting marks extra cell, for adding disconnecting label for original RabbitMQ service providing node;
It is corresponding, replace node selection and service holding unit specifically:
Any available RabbitMQ service providing node work for not being attached with disconnecting and marking is selected from available section point set To replace node.
Further, the system of holding RabbitMQ service can also include:
Node sequencing table generation unit, for enabled node to be concentrated to include each available by predetermined order rule RabbitMQ service providing node is ranked up, and obtains node sequencing table.
Wherein, it replaces node selection and service holding unit 100 may include:
Sequence chooses subelement, is located at the available of top in node sequencing table for choosing by top-down sequence RabbitMQ service providing node is as standby node.
Further, the system of holding RabbitMQ service can also include:
Cyclically-varying information acquisition unit can be used in cluster for obtaining in each predetermined period by predetermined period The change information of RabbitMQ service providing node;
Change information period updating unit, for updating available section point set using information converting.
Based on the above embodiment, present invention also provides a kind of device of holding RabbitMQ service, which be can wrap Include memory and processor, wherein have computer program in the memory, which calls the computer in the memory When program, step provided by above-described embodiment may be implemented.Certainly, which can also include that various necessary networks connect Mouth, power supply and other components etc..
Present invention also provides a kind of computer readable storage mediums, have computer program thereon, the computer program Step provided by above-described embodiment may be implemented when being performed terminal or processor execution.The storage medium may include: U Disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), the various media that can store program code such as magnetic or disk.
Each embodiment is described in a progressive manner in specification, the highlights of each of the examples are with other realities The difference of example is applied, the same or similar parts in each embodiment may refer to each other.For device disclosed in embodiment Speech, since it is corresponded to the methods disclosed in the examples, so being described relatively simple, related place is referring to method part illustration ?.
Professional further appreciates that, unit described in conjunction with the examples disclosed in the embodiments of the present disclosure And algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware and The interchangeability of software generally describes each exemplary composition and step according to function in the above description.These Function is implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Profession Technical staff can use different methods to achieve the described function each specific application, but this realization is not answered Think beyond scope of the present application.
Specific examples are used herein to illustrate the principle and implementation manner of the present application, and above embodiments are said It is bright to be merely used to help understand the present processes and its core concept.For those skilled in the art, Under the premise of not departing from the application principle, can also to the application, some improvement and modification can also be carried out, these improvement and modification It falls into the protection scope of the claim of this application.
It should also be noted that, in the present specification, relational terms such as first and second and the like be used merely to by One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning Covering non-exclusive inclusion, so that the process, method, article or equipment for including a series of elements not only includes that A little elements, but also other elements including being not explicitly listed, or further include for this process, method, article or The intrinsic element of equipment.In the absence of more restrictions, the element limited by sentence "including a ...", is not arranged Except there is also other identical elements in the process, method, article or equipment for including element.

Claims (10)

1. a kind of method for keeping RabbitMQ service characterized by comprising
Receive the information returned from the former RabbitMQ service providing node that connection has been established;
Judge to receive whether the duration of the information is more than preset duration away from the last time;
If so, concentrating the available RabbitMQ clothes for selecting any non-original RabbitMQ service providing node from enabled node Business provides node as replacement node, and establishes connection with the replacement node to keep RabbitMQ to service;Wherein, described can Node identity information and connection including all available RabbitMQ service providing nodes in cluster is concentrated to establish information with node, And the available section point set is pre-stored within RabbitMQ client local.
2. the method according to claim 1, wherein the generating process of the available section point set includes:
Obtain each respective available mode information of RabbitMQ service providing node in the cluster;
Determine that belonging to the RabbitMQ that can use RabbitMQ service providing node services according to each available mode information Node is provided;
It can described in information generation according to each described can be established with the node identity information of RabbitMQ service providing node and connection With node collection.
3. the method according to claim 1, wherein selecting any non-original concentrating from enabled node Before the available RabbitMQ service providing node of RabbitMQ service providing node is as replacement node, further includes:
Disconnecting label is added for the original RabbitMQ service providing node;
It is corresponding, the available RabbitMQ clothes for selecting any non-original RabbitMQ service providing node are concentrated from enabled node Business provides node as replacement node specifically:
Any available RabbitMQ service offer section for not being attached with the disconnecting and marking is selected from the available section point set Point is as replacement node.
4. according to the method described in claim 2, it is characterized in that, according to each RabbitMQ service providing node Node identity information and connection establish after information generates the available section point set, further includes:
Each available RabbitMQ service providing node for including is concentrated to be ranked up the enabled node by predetermined order rule, Obtain node sequencing table.
5. according to the method described in claim 4, it is characterized in that, concentrating any available RabbitMQ clothes of selection from enabled node Business provides node as standby node, comprising:
The available RabbitMQ service providing node for being located at top in the node sequencing table is chosen by top-down sequence As the standby node.
6. method according to any one of claims 1 to 5, which is characterized in that further include:
RabbitMQ service providing node can be used by obtaining by predetermined period described in the cluster in each predetermined period Change information;
The available section point set is updated using the information converting.
7. a kind of system for keeping RabbitMQ service characterized by comprising
Information receiving unit, for receiving the information returned from the former RabbitMQ service providing node that connection has been established;
Disconnecting judging unit receives whether the duration of the information is more than preset duration away from the last time for judging;
Node selection and service holding unit are replaced, is used for when the duration is more than the preset duration, from available section point set The middle available RabbitMQ service providing node for selecting any non-original RabbitMQ service providing node as replacement node, And connection is established to keep RabbitMQ to service with the replacement node;Wherein, it includes institute in cluster that the enabled node, which is concentrated, There are the node identity information of available RabbitMQ service providing node and connection to establish information, and the available section point set is deposited in advance It is local to be stored in RabbitMQ client.
8. system according to claim 7, which is characterized in that further include:
Available mode information acquisition unit, for obtaining each respective available shape of RabbitMQ service providing node in the cluster State information;
RabbitMQ service providing node determination unit can be used, for determined according to each available mode information belong to it is described can With the RabbitMQ service providing node of RabbitMQ service providing node;
Available section point set generation unit, for according to each node identity information with RabbitMQ service providing node and Connection establishes information and generates the available section point set.
9. a kind of RabbitMQ client characterized by comprising
Memory, for storing computer program;
Processor realizes such as holding RabbitMQ as claimed in any one of claims 1 to 6 when for executing the computer program The step of method of service.
10. a kind of computer readable storage medium, which is characterized in that be stored with computer on the computer readable storage medium Program realizes that holding RabbitMQ as claimed in any one of claims 1 to 6 such as takes when the computer program is executed by processor The step of method of business.
CN201810689441.5A 2018-06-28 2018-06-28 A kind of method, system and relevant apparatus keeping RabbitMQ service Pending CN108933824A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810689441.5A CN108933824A (en) 2018-06-28 2018-06-28 A kind of method, system and relevant apparatus keeping RabbitMQ service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810689441.5A CN108933824A (en) 2018-06-28 2018-06-28 A kind of method, system and relevant apparatus keeping RabbitMQ service

Publications (1)

Publication Number Publication Date
CN108933824A true CN108933824A (en) 2018-12-04

Family

ID=64446444

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810689441.5A Pending CN108933824A (en) 2018-06-28 2018-06-28 A kind of method, system and relevant apparatus keeping RabbitMQ service

Country Status (1)

Country Link
CN (1) CN108933824A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109815056A (en) * 2019-01-22 2019-05-28 珠海格力电器股份有限公司 Realize method, apparatus, storage medium and the equipment of message queue reconnection
CN112003929A (en) * 2020-08-21 2020-11-27 苏州浪潮智能科技有限公司 RabbitMQ cluster-based thermal restoration method, system, device and medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103442030A (en) * 2013-07-31 2013-12-11 北京京东尚科信息技术有限公司 Method and system for sending and processing service request messages and client-side device
CN104753817A (en) * 2013-12-25 2015-07-01 中国移动通信集团公司 Local analogy method and local analogy system for cloud computing message queue service
CN104994173A (en) * 2015-07-16 2015-10-21 浪潮(北京)电子信息产业有限公司 Message processing method and system
CN105915650A (en) * 2016-06-21 2016-08-31 腾讯科技(深圳)有限公司 Load balancing method and device
CN106209602A (en) * 2016-08-04 2016-12-07 北京迅达云成科技有限公司 Across data center's multipath high reliability message delivery system
CN106357452A (en) * 2016-09-29 2017-01-25 上海和付信息技术有限公司 High-availability framework system with single-point heterogeneous data storage function and realizing method thereof
CN106789257A (en) * 2016-12-23 2017-05-31 航天星图科技(北京)有限公司 A kind of cloud system server state visual management method
CN106856489A (en) * 2015-12-08 2017-06-16 阿里巴巴集团控股有限公司 A kind of service node switching method and apparatus of distributed memory system
CN107066526A (en) * 2017-02-23 2017-08-18 武汉智寻天下科技有限公司 A kind of network crawler system and method
CN107395768A (en) * 2017-09-05 2017-11-24 上海焕兴网络科技有限公司 Two-shipper adaptive load balancing method for file security transmission
CN108199896A (en) * 2018-01-16 2018-06-22 中电福富信息科技有限公司 Distributed message delivery system based on RabbitMQ

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103442030A (en) * 2013-07-31 2013-12-11 北京京东尚科信息技术有限公司 Method and system for sending and processing service request messages and client-side device
CN104753817A (en) * 2013-12-25 2015-07-01 中国移动通信集团公司 Local analogy method and local analogy system for cloud computing message queue service
CN104994173A (en) * 2015-07-16 2015-10-21 浪潮(北京)电子信息产业有限公司 Message processing method and system
CN106856489A (en) * 2015-12-08 2017-06-16 阿里巴巴集团控股有限公司 A kind of service node switching method and apparatus of distributed memory system
CN105915650A (en) * 2016-06-21 2016-08-31 腾讯科技(深圳)有限公司 Load balancing method and device
CN106209602A (en) * 2016-08-04 2016-12-07 北京迅达云成科技有限公司 Across data center's multipath high reliability message delivery system
CN106357452A (en) * 2016-09-29 2017-01-25 上海和付信息技术有限公司 High-availability framework system with single-point heterogeneous data storage function and realizing method thereof
CN106789257A (en) * 2016-12-23 2017-05-31 航天星图科技(北京)有限公司 A kind of cloud system server state visual management method
CN107066526A (en) * 2017-02-23 2017-08-18 武汉智寻天下科技有限公司 A kind of network crawler system and method
CN107395768A (en) * 2017-09-05 2017-11-24 上海焕兴网络科技有限公司 Two-shipper adaptive load balancing method for file security transmission
CN108199896A (en) * 2018-01-16 2018-06-22 中电福富信息科技有限公司 Distributed message delivery system based on RabbitMQ

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109815056A (en) * 2019-01-22 2019-05-28 珠海格力电器股份有限公司 Realize method, apparatus, storage medium and the equipment of message queue reconnection
CN112003929A (en) * 2020-08-21 2020-11-27 苏州浪潮智能科技有限公司 RabbitMQ cluster-based thermal restoration method, system, device and medium
CN112003929B (en) * 2020-08-21 2022-05-13 苏州浪潮智能科技有限公司 RabbitMQ cluster-based thermal restoration method, system, device and medium

Similar Documents

Publication Publication Date Title
CN103460203B (en) cluster unique identifier
CN109617807B (en) Route information update method, device, gateway and storage medium
CN102546135B (en) Active/standby server switched system and method
WO2022127504A1 (en) Network element management method and apparatus, and storage medium
CN108173911A (en) A kind of micro services fault detect processing method and processing device
US20130346513A1 (en) Migrating a chat message service provided by a chat server to a new chat server
CN106294073A (en) Service calling method and device
CN101123603B (en) Configurable Ethernet interface backup system and method
US20220022062A1 (en) Methods and Related Devices for Implementing Disaster Recovery
CN112953982B (en) Service processing method, service configuration method and related device
CN102917039A (en) Information processing method and system
CN108933824A (en) A kind of method, system and relevant apparatus keeping RabbitMQ service
CN104901828A (en) Equipment end fault removing method
CN111935314B (en) Block chain system, message transmission method and device
CN109151082A (en) A kind of multi-connection method for building up, device and system
CN106656659B (en) Network path selection method and network video recorder
CN107547550A (en) Authentication method and device
CN110913010A (en) SIP service cluster system and implementation method
CN101217293B (en) Media operation trusteeship switching system and method
CN112613919A (en) Information processing method and related device
CN113507431A (en) Message management method, device, equipment and machine readable storage medium
CN111817953A (en) Method and device for electing master equipment based on Virtual Router Redundancy Protocol (VRRP)
CN105610708B (en) The implementation method and RB equipment of multicast FRR in a kind of TRILL network
CN108243397B (en) Short message sending method and short message gateway equipment
CN115086203A (en) Data transmission method, data transmission device, electronic equipment and computer-readable 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20181204