[summary of the invention]
The many aspects of the application provide a kind of message issuance method, apparatus and system, to reduce message center cluster
Network overhead.
The one side of the application provides a kind of message issuance method, comprising:
The unavailable instruction that first message center is sent in message center cluster is received, to indicate in the first message
The heart is unavailable, and the message center cluster includes the first message center and second message center;
According to the unavailable instruction, the identification information at the available message center of the message center cluster is updated;
The application system serviced to the message center cluster, sends the identification information at the available message center, with
So that identification information of the application system according to the available message center, selects an available message center to execute message and passes
Defeated operation.
The aspect and any possible implementation manners as described above, it is further provided a kind of implementation, it is described according to institute
Unavailable instruction is stated, the identification information at the available message center of the message center cluster is updated, comprising:
According to the unavailable instruction, by the identification information at the first message center, from the message center cluster
It is deleted in the identification information at available message center.
The aspect and any possible implementation manners as described above, it is further provided a kind of implementation, it is described unavailable
Instruction includes that process terminates instruction.
The aspect and any possible implementation manners as described above, it is further provided a kind of implementation, it is described according to institute
Unavailable instruction is stated, before the identification information for updating the available message center of the message center cluster, further includes:
The available instruction that the first message center is sent is received, to indicate that the first message center is available;
Instruction is used according to described, updates the identification information at the available message center of the message center cluster.
The aspect and any possible implementation manners as described above, it is further provided a kind of implementation, it is described according to institute
Unavailable instruction is stated, the identification information at the available message center of the message center cluster is updated, comprising:
Instruction is used according to described, by the identification information at the first message center, is added to the message center cluster
Available message center identification information in.
The aspect and any possible implementation manners as described above, it is further provided a kind of implementation, it is described can be with referring to
Show and starts to indicate including process.
The aspect and any possible implementation manners as described above, it is further provided a kind of implementation, the reception disappear
It ceases in center cluster before the unavailable instruction of first message center transmission, further includes:
Shutdown hook is arranged in the first message center, to intercept and capture the process termination message at the first message center;
If the shutdown hook intercepts and captures the process termination message at the first message center, the first message center is called
Hook Function corresponding to the shutdown hook, to send the unavailable instruction.
The another aspect of the application provides a kind of news release device, comprising:
Receiving unit, for receiving the unavailable instruction that first message center is sent in message center cluster, to indicate
The first message center is unavailable, and the message center cluster includes the first message center and second message center;
Updating unit, for updating the available message center of the message center cluster according to the unavailable instruction
Identification information;
Transmission unit, the application system for being serviced to the message center cluster, sends the available message center
Identification information so that identification information of the application system according to the available message center, selects an available message
Center executes message transfer operations.
The aspect and any possible implementation manners as described above, it is further provided a kind of implementation, the update are single
Member is specifically used for
According to the unavailable instruction, by the identification information at the first message center, from the message center cluster
It is deleted in the identification information at available message center.
The aspect and any possible implementation manners as described above, it is further provided a kind of implementation, it is described unavailable
Instruction includes that process terminates instruction.
The aspect and any possible implementation manners as described above, it is further provided a kind of implementation,
The receiving unit, is also used to
The available instruction that the first message center is sent is received, to indicate that the first message center is available;
The updating unit, is also used to
Instruction is used according to described, updates the identification information at the available message center of the message center cluster.
The aspect and any possible implementation manners as described above, it is further provided a kind of implementation, the update are single
Member is specifically used for
Instruction is used according to described, by the identification information at the first message center, is added to the message center cluster
Available message center identification information in.
The aspect and any possible implementation manners as described above, it is further provided a kind of implementation, it is described can be with referring to
Show and starts to indicate including process.
The another aspect of the application provides a kind of message publishing system, including message center cluster, the message center collection
The application system and above-mentioned another aspect that group is serviced and news release device provided by its any possible implementation;Institute
Stating message center cluster includes first message center and second message center;Wherein,
The first message center, for sending unavailable instruction to the news release device;
The application system, for receiving the identification information at the available message center that the news release device is sent;With
And the identification information according to the available message center, select an available message center to execute message transfer operations.
The aspect and any possible implementation manners as described above, it is further provided a kind of implementation, described first disappears
Breath center, is also used to
Shutdown hook is set, to intercept and capture the process termination message at the first message center;And
If the shutdown hook intercepts and captures the process termination message at the first message center, call the shutdown hook institute right
The Hook Function answered, to send the unavailable instruction.
As shown from the above technical solution, the embodiment of the present application is sent by receiving first message center in message center cluster
Unavailable instruction update the mark at the available message center of the message center cluster and then according to the unavailable instruction
Information makes it possible to the application system serviced to the message center cluster, sends the mark letter at the available message center
Breath, so that identification information of the application system according to the available message center, selects an available message center to execute
Message transfer operations, as the unavailable instruction according to transmitted by not available message center, that is, first message center, update disappears
The identification information at the available message center of center cluster is ceased, application system is dynamically known can in message center cluster
Message center, therefore, application system can once be successfully selected available message center and execute message transfer operations, and nothing
Other message centers need to be chosen over and execute message transfer operations, can be avoided in the prior art since application system is selected repeatedly
It selects other message centers and executes the data increased caused by message transfer operations between application system and message center cluster
Interactive problem, to reduce the network overhead of message center cluster.
In addition, application system once can be just successfully selected in available message using technical solution provided by the present application
The heart executes message transfer operations, therefore will not generate without being chosen over other message centers execution message transfer operations
A large amount of error messages and monitoring alarm, can be further reduced the network overhead of message center cluster.
In addition, application system can dynamically be known can in message center cluster using technical solution provided by the present application
Message center, and then it is no longer influenced by any influence of not available message center, message center cluster can be effectively improved
Stability.
[specific embodiment]
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
Whole other embodiments obtained without creative efforts, shall fall in the protection scope of this application.
In addition, the terms "and/or", only a kind of incidence relation for describing affiliated partner, indicates may exist
Three kinds of relationships, for example, A and/or B, can indicate: individualism A exists simultaneously A and B, these three situations of individualism B.Separately
Outside, character "/" herein typicallys represent the relationship that forward-backward correlation object is a kind of "or".
Fig. 1 is the flow diagram for the message issuance method that one embodiment of the application provides, as shown in Figure 1.
101, the unavailable instruction that first message center is sent in message center cluster is received, to indicate that described first disappears
Breath center is unavailable, and the message center cluster includes the first message center and second message center.
102, according to the unavailable instruction, the identification information at the available message center of the message center cluster is updated.
103, the application system that Xiang Suoshu message center cluster is serviced sends the mark letter at the available message center
Breath, so that identification information of the application system according to the available message center, selects an available message center to execute
Message transfer operations.
It should be noted that 101~103 executing subject can be the group newly increased in the server of network side
Part, or can also be the plug-in unit or Software Development Tools in the server of network side in existing component such as configuration center
Functional units such as (Software Development Kit, SDK) are wrapped, the present embodiment is to this without being particularly limited to.
In this way, as the unavailable instruction according to transmitted by not available message center, that is, first message center, update disappears
The identification information at the available message center of center cluster is ceased, application system is dynamically known can in message center cluster
Message center, therefore, application system can once be successfully selected available message center and execute message transfer operations, and nothing
Other message centers need to be chosen over and execute message transfer operations, can be avoided in the prior art since application system is selected repeatedly
It selects other message centers and executes the data increased caused by message transfer operations between application system and message center cluster
Interactive problem, to reduce the network overhead of message center cluster.
The so-called first message center, is not available message center in message center cluster, and quantity can be
One, or can also be to be multiple, the present embodiment is to this without being particularly limited to.
The so-called second message center, is available message center in message center cluster, and quantity can be one
It is a, or can also be to be multiple, the present embodiment is to this without being particularly limited to.
In the present embodiment, each first disappear at least one first message center included by the message center cluster
Each second message center in breath center and at least one second message center can execute publisher and register operation, with note
Volume is the message issuer of executing subject;Each application system in several application systems that the message center cluster is serviced
System can then execute corresponding subscriber and register operation, to be registered as the message subscribing person of executing subject.
So far, each first message center and at least one second message center at least one first message center
In each second message center, have registered the news release service of executing subject;Correspondingly, the message center cluster is taken
Each application system in several application systems of business, has registered the message subscribing service of executing subject.When any one disappears
When breath center has message to need to issue, for example, available instruction or unavailable instruction corresponding to the working condition of the message center
Then the message informing issued can be given to each application system in real time Deng, executing subject.
Optionally, in a possible implementation of the present embodiment, in 101, the received unavailable finger of institute
Show that the process that can include but is not limited to terminates instruction, the present embodiment is to this without being particularly limited to.
During a concrete implementation, the received unavailable instruction of institute is specifically as follows first message center
The process of transmission terminates instruction, to indicate that the first message center is unavailable.
During another concrete implementation, the received unavailable instruction of institute is specifically as follows in first message
The dedicated instruction that the heart is sent, to indicate that the first message center is unavailable.
Optionally, in a possible implementation of the present embodiment, before 102, institute can also further be received
The available instruction for stating the transmission of first message center, to indicate that the first message center is available, and then then can be according to described
Instruction can be used, update the identification information at the available message center of the message center cluster.
Specifically, specifically instruction can be used according to described, by the identification information at the first message center, is added to institute
It states in the identification information at available message center of message center cluster.
During a concrete implementation, the process that can be can include but is not limited to instruction starts to indicate, this reality
Example is applied to this without being particularly limited to.
For example, received described can use of institute indicates that the process for being specifically as follows the transmission of first message center starts to indicate, use
To indicate that the first message center is available.
Alternatively, for another example received described can use of institute indicates that one for being specifically as follows the transmission of first message center is dedicated
Instruction, to indicate that the first message center is available.
Optionally, in a possible implementation of the present embodiment, in 102, specifically can according to it is described can not
The identification information at the first message center is believed from the mark at the available message center of the message center cluster with instruction
It is deleted in breath.
It should be noted that herein, the identification information at the available message center of message center cluster, be specifically as follows including
One list of several message centers mark, the indicated message center of these marks in the list, is message center collection
Available message center included by group.On the contrary, not in the list message center mark, indicated by message center,
For not available message center, for example, message center publication or restarting process corresponding to i.e. message center and terminating etc..
Wherein, message center identifies, and can include but is not limited to the number of message center, or can also be message center
Uniform resource locator (Uniform Resource Locator, URL) or uniform resource name (Uniform Resource
Name, URN), either can also include other can unique identification or access message center other identifier, the present embodiment pair
This is without being particularly limited to.
It is understood that after message center publication, disposed in the application system that is serviced and message center
Corresponding client can be referred to the respective version newly issued immediately, to adapt to the message center that publication finishes.
Optionally, in a possible implementation of the present embodiment, before 101, the first message center is also
Shutdown hook can be further set, for example, Runtime.getRuntime () .addShutdownHook (hook) etc., is used
To intercept and capture the process termination message at the first message center.If the shutdown hook intercepts and captures the process at the first message center
Termination message, the first message center can then call Hook Function corresponding to the shutdown hook, described not with transmission
Instruction can be used.
So far, the news release service of executing subject has been nullified at the first message center.
Specifically, specifically shutdown hook can be arranged in the process of creation in the first message center.
In the present embodiment, by receiving the unavailable instruction that first message center is sent in message center cluster, Jin Ergen
According to the unavailable instruction, the identification information at the available message center of the message center cluster is updated, is made it possible to described
The application system that message center cluster is serviced sends the identification information at the available message center, so that the application system
System selects an available message center to execute message transfer operations, due to root according to the identification information at the available message center
According to unavailable instruction transmitted by not available message center, that is, first message center, the available message of update message center cluster
The identification information at center enables application system dynamically to know that in message center cluster therefore available message center is answered
Available message center can be once successfully selected with system and executes message transfer operations, without being chosen over other message
Center executes message transfer operations, can be avoided and executes in the prior art since application system is chosen over other message centers
The problem of increasing the data interaction between application system and message center cluster caused by message transfer operations, to reduce
The network overhead of message center cluster.
In addition, application system once can be just successfully selected in available message using technical solution provided by the present application
The heart executes message transfer operations, therefore will not generate without being chosen over other message centers execution message transfer operations
A large amount of error messages and monitoring alarm, can be further reduced the network overhead of message center cluster.
In addition, application system can dynamically be known can in message center cluster using technical solution provided by the present application
Message center, and then it is no longer influenced by any influence of not available message center, message center cluster can be effectively improved
Stability.
It should be noted that for the various method embodiments described above, for simple description, therefore, it is stated as a series of
Combination of actions, but those skilled in the art should understand that, the application is not limited by the described action sequence because
According to the application, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art should also know
It knows, the embodiments described in the specification are all preferred embodiments, related actions and modules not necessarily the application
It is necessary.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment
Point, reference can be made to the related descriptions of other embodiments.
Fig. 2 is the structural schematic diagram for the news release device that another embodiment of the application provides, as shown in Figure 2.This implementation
The news release device of example may include receiving unit 21, updating unit 22 and transmission unit 23.Wherein, receiving unit 21 are used
In receiving the unavailable instruction that first message center is sent in message center cluster, to indicate that the first message center can not
With the message center cluster includes the first message center and second message center;Updating unit 22, for according to
Unavailable instruction updates the identification information at the available message center of the message center cluster;Transmission unit 23 is used for described
The application system that message center cluster is serviced sends the identification information at the available message center, so that the application system
System selects an available message center to execute message transfer operations according to the identification information at the available message center.
It should be noted that news release device provided by the present embodiment can be new in the server of network side
Increased component, or can also be the plug-in unit or software in the server of network side in existing component such as configuration center
The functional units such as development kit (Software Development Kit, SDK), the present embodiment is to this without especially limiting
It is fixed.
Optionally, in a possible implementation of the present embodiment, the updating unit 22 specifically can be used for root
According to the unavailable instruction, by the identification information at the first message center, from the available message of the message center cluster
It is deleted in the identification information of the heart.
Optionally, in a possible implementation of the present embodiment, the unavailable instruction may include but unlimited
It terminates and indicates in process, the present embodiment is to this without being particularly limited to.
Optionally, in a possible implementation of the present embodiment, the receiving unit 21 can also be used further
In the available instruction for receiving the first message center transmission, to indicate that the first message center is available;Correspondingly, described
Updating unit 22 can be also used for that instruction can be used according to, update the mark at the available message center of the message center cluster
Know information.
Specifically, the updating unit 22 specifically can be used for that instruction can be used according to, by the first message center
Identification information, be added in the identification information at the available message center of the message center cluster.
Optionally, described to be can include but is not limited to instruction in a possible implementation of the present embodiment
Process starts to indicate, the present embodiment is to this without being particularly limited to.
It should be noted that method in the corresponding embodiment of Fig. 2, it can be real by news release device provided in this embodiment
It is existing.Detailed description may refer to the related content in the corresponding embodiment of Fig. 2, and details are not described herein again.
In the present embodiment, the unavailable finger that first message center is sent in message center cluster is received by receiving unit
Show, and then the mark at the available message center of the message center cluster is updated according to the unavailable instruction by updating unit
Information, the application system that transmission unit is serviced to the message center cluster send the available message center
Identification information so that identification information of the application system according to the available message center, selects an available message
Center executes message transfer operations, as the unavailable finger according to transmitted by not available message center, that is, first message center
Show, the identification information at the available message center of update message center cluster enables application system dynamically to know in message
Available message center in heart cluster, therefore, application system can once be successfully selected available message center and execute message biography
Defeated operation executes message transfer operations without being chosen over other message centers, can be avoided in the prior art due to answering
Increase application system and message center collection caused by selecting other message centers to execute message transfer operations with system repeatedly
Group between data interaction the problem of, to reduce the network overhead of message center cluster.
In addition, application system once can be just successfully selected in available message using technical solution provided by the present application
The heart executes message transfer operations, therefore will not generate without being chosen over other message centers execution message transfer operations
A large amount of error messages and monitoring alarm, can be further reduced the network overhead of message center cluster.
In addition, application system can dynamically be known can in message center cluster using technical solution provided by the present application
Message center, and then it is no longer influenced by any influence of not available message center, message center cluster can be effectively improved
Stability.
Fig. 3 is the structural schematic diagram for the message publishing system that another embodiment of the application provides, as shown in Figure 3.This implementation
The message publishing system of example may include the application system 34 that message center cluster 30, the message center cluster 30 are serviced1、
342……34mNews release device 31 provided by embodiment corresponding with Fig. 2;Specifically, the message center cluster 30 can
To include first message center 32 and second message center 331、332……33n.Wherein, the first message center 32, is used for
Unavailable instruction is sent to the news release device;The application system 341、342……34m, for receiving the message hair
The identification information at the available message center that cloth apparatus is sent;And the identification information according to the available message center, select one
A available message center executes message transfer operations.
The detailed description of the news release device 31 may refer to the related content in the corresponding embodiment of Fig. 2, herein
It repeats no more.
Optionally, in a possible implementation of the present embodiment, the first message center 32 can also be into one
Step is for being arranged shutdown hook, to intercept and capture the process termination message at the first message center 32;And if the closing hook
Son intercepts and captures the process termination message at the first message center 32, calls Hook Function corresponding to the shutdown hook, with hair
Send the unavailable instruction.
In the present embodiment, sent by first message center in news release device reception message center cluster unavailable
Instruction, and then according to the unavailable instruction, the identification information at the available message center of the message center cluster is updated, so that
The application system that the news release device can be serviced to the message center cluster, sends the available message center
Identification information, so that identification information of the application system according to the available message center, selects in an available message
The heart executes message transfer operations, as the unavailable instruction according to transmitted by not available message center, that is, first message center,
The identification information at the available message center of update message center cluster, enables application system dynamically to know message center collection
Available message center in group, therefore, application system can once be successfully selected available message center and execute message transmission behaviour
Make, execute message transfer operations without being chosen over other message centers, can be avoided in the prior art since application is
System be chosen over other message centers execute increase caused by message transfer operations application system and message center cluster it
Between data interaction the problem of, to reduce the network overhead of message center cluster.
In addition, application system once can be just successfully selected in available message using technical solution provided by the present application
The heart executes message transfer operations, therefore will not generate without being chosen over other message centers execution message transfer operations
A large amount of error messages and monitoring alarm, can be further reduced the network overhead of message center cluster.
In addition, application system can dynamically be known can in message center cluster using technical solution provided by the present application
Message center, and then it is no longer influenced by any influence of not available message center, message center cluster can be effectively improved
Stability.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description,
The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In several embodiments provided herein, it should be understood that disclosed system, device and method can be with
It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the unit
It divides, only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components
It can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, it is shown or
The mutual coupling, direct-coupling or communication connection discussed can be through some interfaces, the indirect coupling of device or unit
It closes or communicates to connect, can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple
In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme
's.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of hardware adds SFU software functional unit.
The above-mentioned integrated unit being realized in the form of SFU software functional unit can store and computer-readable deposit at one
In storage media.Above-mentioned SFU software functional unit is stored in a storage medium, including some instructions are used so that a computer
It is each that equipment (can be personal computer, server or the network equipment etc.) or processor (processor) execute the application
The part steps of embodiment the method.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (Read-
Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic or disk etc. it is various
It can store the medium of program code.
Finally, it should be noted that above embodiments are only to illustrate the technical solution of the application, rather than its limitations;Although
The application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it still may be used
To modify the technical solutions described in the foregoing embodiments or equivalent replacement of some of the technical features;
And these are modified or replaceed, each embodiment technical solution of the application that it does not separate the essence of the corresponding technical solution spirit and
Range.