CN107395729A - A kind of consumption system of message queue, method and device - Google Patents
A kind of consumption system of message queue, method and device Download PDFInfo
- Publication number
- CN107395729A CN107395729A CN201710624568.4A CN201710624568A CN107395729A CN 107395729 A CN107395729 A CN 107395729A CN 201710624568 A CN201710624568 A CN 201710624568A CN 107395729 A CN107395729 A CN 107395729A
- Authority
- CN
- China
- Prior art keywords
- message
- consumer
- message queue
- data
- cluster
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/141—Setup of application sessions
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/51—Discovery or management thereof, e.g. service location protocol [SLP] or web services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
Abstract
The invention discloses a kind of message queue consumption system, method and device.The system includes:Message Queuing server's cluster, for storing message data;Message queue unifies consumer client, for by running consumer's example for being pre-created, establishing and connecting with Message Queuing server's cluster, and obtains and distribute the message data that the message queue in Message Queuing server's cluster of subscription stores;Customer service, unify consumer client with the message queue and be connected, unify the message data of consumer client's distribution for receiving and handling the message queue.The present invention unifies consumer client by disposing message queue, realize the decoupling between the application programming interfaces of the service code logical AND message queue in customer service, the exploitation maintenance difficulties brought due to message queue change of product are reduced, while reduce the energy and cost of user's input.
Description
Technical field
The present embodiments relate to communication technical field, more particularly to a kind of consumption system of message queue, method and dress
Put.
Background technology
Message queue is widely used under high concurrent, high capacity, big data quantity application scenarios in internet industry.
A large amount of outstanding message queue products have been emerged in large numbers at present, but these message queue products possess the advantage of itself and applicable field
Scape.As user due to the change of the objective factors such as technological reserve, operation expanding, it is necessary to change message queue.
In the prior art, need to due to strong coupling between the application programming interfaces of service code logical AND message queue
The service code logic that significantly change in each customer service, huge pressure can be brought to business development personnel and is chosen
War.In addition, development process is carried out using the component of secondary encapsulation, although the cost that change message queue is paid can be mitigated,
It is all to be upgraded simultaneously using needs using the component when edition upgrading is carried out per sub-assembly, make follow-up exploitation and safeguard consumption
Take energy and fund cost.
The content of the invention
The present invention provides a kind of consumption system of message queue, method and device, to realize service code logical AND message
Decoupling between the application programming interfaces of queue, the exploitation maintenance difficulties brought due to message queue change of product are reduced, simultaneously
Reduce the energy and cost of user's input.
In a first aspect, the embodiments of the invention provide a kind of consumption system of message queue, the system includes:
Message Queuing server's cluster, for storing message data;
Message queue unifies consumer client, for the consumer's example being pre-created by operation, with the message
Queue server cluster establishes connection, and obtains and distribute the message queue in Message Queuing server's cluster of subscription
The message data of storage;
Customer service, unify consumer client with the message queue and be connected, for receiving and handling the message
The message data of consumer client's distribution is unified in queue.
Second aspect, the embodiments of the invention provide a kind of consuming method of message queue, this method includes:
By running the consumer's example being pre-created, with Message Queuing server's cluster foundation connection;
After connection is established with Message Queuing server's cluster, in the Message Queuing server's cluster for obtaining subscription
The message data of message queue storage;
Distribute the message data to corresponding customer service and/or consumer's calling agency service.
The third aspect, the embodiment of the present invention additionally provide a kind of consumption device of message queue, and the device includes:
Link block, for the consumer's example being pre-created by operation, with cluster foundation company of Message Queuing server
Connect;
Acquisition module, for after connection is established with Message Queuing server's cluster, obtaining the message queue of subscription
The message data of message queue storage in server cluster;
Distribution module, for distributing the message data to corresponding customer service and/or consumer's calling agency's clothes
Business.
The present invention by disposing message queue unifies consumer client, solve change message queue product to user with
Carry out the problem of inconvenient, realize the solution between the application programming interfaces of the service code logical AND message queue in customer service
Coupling, the exploitation maintenance difficulties brought due to message queue change of product are reduced, while reduce the energy and cost of user's input.
Brief description of the drawings
Figure 1A is a kind of message queue consumption system structural representation in the embodiment of the present invention one.
Figure 1B is that the single message queue in the embodiment of the present invention one unifies consumer client's deployment call graph.
Fig. 1 C are that multiple message queues in the embodiment of the present invention one unify consumer client's deployment and expansion relation figure.
Fig. 2 is a kind of message queue consuming method schematic flow sheet in the embodiment of the present invention two.
Fig. 3 is a kind of preferable message queue consuming method schematic flow sheet in the embodiment of the present invention three.
Fig. 4 is a kind of structural representation of message queue consumption device in the embodiment of the present invention four
Embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining the present invention, rather than limitation of the invention.It also should be noted that in order to just
Part related to the present invention rather than entire infrastructure are illustrate only in description, accompanying drawing.
Embodiment one
Fig. 1 is a kind of message queue consumption system structural representation that the embodiment of the present invention one provides.The present embodiment can fit
For the situation for the message data for consuming message queue.The consumption system includes:
Message Queuing server's cluster 110, for storing message data;
Message queue unifies consumer client 120, for by running the consumer's example being pre-created, disappearing with described
Cease queue server cluster and establish connection, and obtain and distribute the message team in Message Queuing server's cluster of subscription
Arrange the message data of storage;
Customer service 130, and unifying consumer client with the message queue is connected, for receiving the message queue
The message data of unified consumer client's distribution.
Wherein, message queue unifies the message queue consumer example journey centralized as one of consumer client 120
Sequence, constantly obtain message data from Message Queuing server's cluster 110.It is worth noting that the acquisition modes of message data
It can be push-model or pull-mode, this is not limited.
Customer service 130, and unifying consumer client with the message queue is connected, for receiving and handling described disappear
The message data of consumer client's distribution is unified in breath queue.
Wherein, customer service 130 can be local specific consumption logical code or remote procedure call
Remote service.
The technical scheme of the present embodiment, unify consumer client 120 by disposing message queue, obtain message queue clothes
The message data stored in business device cluster 110, and the message data is distributed to customer service 130.Make as information consumption
The customer service 130 of logic is handled, without being concerned about the specific source of the message data received, only specific business need to be carried out and patrol
Collect processing.Now, the business logic codes in customer service 130 are independent of any and Message Queuing server's cluster 110
Related program code or bag, solve the problems, such as that change message queue product makes troubles to user, realizes consumer
The application programming interfaces of business logic codes and message queue in service 130 decouple, and reduce because message queue product becomes
The exploitation maintenance difficulties more brought, while reduce the energy and cost of user's input.
Preferably, the consumption system, in addition to:
Configuration center 140, unify consumer client with the message queue and be connected, for issuing the connection being pre-configured with
Parameter information and Consumption relation data to the message queue unify consumer client;
Wherein, the message queue unifies consumer client 120 according to the Connecting quantity information and the message team
Row server cluster 110 establishes a connection;Taken according to the message data that the Consumption relation data determine to obtain and consumer
The incidence relation of business 130, and customer service 130 corresponding to according to the incidence relation message data of acquisition is distributed to.
Wherein, Connecting quantity information comprises at least the IP of the Zhong Ge Message Queuing servers of Message Queuing server's cluster 110
List.The other specification information that Connecting quantity packet contains and message queue of the specific message queue product about deployment selected
The product type of server cluster 110 is different, then the content that Connecting quantity packet contains also differs.Exemplarily, Connecting quantity
Information can also include user's list of file names, cipher list etc..
Wherein, configuration center 140 can be Zookeeper clusters, can also select other programs.
Exemplarily, when disposing Zookeeper clusters as configuration center 140, the configuration of Connecting quantity information therein
Information comprises at least node content and node path.Wherein, node content can be " { " broker.ips ":"
192.168.10.81:61616 " form } ", for storing some message in Message Queuing server's cluster 110 to be connected
IP address corresponding to queue server.Node path can be "/mq/server/info " form, for representing node content
Specific store path in configuration center 140.Specifically, message queue unifies the acquisition configuration center of consumer client 120
During Connecting quantity information in 140, node content is obtained according to above-mentioned node path.Message queue unifies consumer client
120, according to the IP address in the node content of acquisition, establish with corresponding Message Queuing server and connect, ordered for subsequently obtaining
The message data read.
Wherein, message data relevant information and customer service's information are comprised at least in Consumption relation data, can also be wrapped
Include the relevant information that such as message queue unifies specific consumer's example in consumer client 120.Wherein, message data phase
It can be the theme of message data or queue in the Message Queuing server's cluster 110 subscribed to close information, and it is such as right to may also include
The other informations such as the functional descriptions of message data;Customer service's information can be the title of customer service, version, point
Group, specific method, interface or function name etc..Consumption relation data can also need to increase other specification according to realization,
This does not do any restriction.Specifically, message queue unifies message data of the consumer client 120 in Consumption relation data
Theme or the message data relevant information such as queue and functional descriptions, will be connect from Message Queuing server's cluster 110
The message data of receipts is distributed to the title of customer service 130, version, packet, specific method, interface and function name etc.
In the corresponding customer service 130 of customer service's information.
Exemplarily, when disposing Zookeeper clusters as configuration center 140, the configuration of Consumption relation data therein
Information comprises at least father node path, child node path and child node content.Wherein, father node path can be "/mq/
Biz/mqClient " form, for the message data of acquisition and customer service that represent to store in configuration center 140 it
Between corresponding relation store path;Child node path can be that "/mq/biz/mqClient/business_1 " form, is used for
Represent the specific store path of the storage child node content in configuration center 140;Child node content can be " { " concurrent example
Number ":2, " functional circuit information ":" consulting is replied in customer service ", director ":" Xiao Ming, a king young waiter in a wineshop or an inn ", " method name of processing
Claim ":" handler ", " service name of processing ":" xxx.xxx.xx.xx.processService ", " service point of processing
Group ":" * ", " consumption group ":" card ", " topic ":[{"topic":" ADVICE_REPLY_MAI " }], " service release ":"
1.0.0 form " } ", for representing the incidence relation between message data and corresponding customer service 130.
Specifically, above-mentioned child node content representation message queue unifies this time process of consumption presence of consumer client 120
Two concurrent consumer's examples, for being " [{ " topic " by theme:" ADVICE_REPLY_MAI " }] ", for realizing " visitor
Reply consulting in family " function, message distribution to the consumption group for being responsible for the message data of artificial " Xiao Ming, a king young waiter in a wineshop or an inn " is " card ", clothes
Be engaged in entitled " xxx.xxx.xx.xx.processService ", and version is in the customer service 140 of " 1.0.0 ", and makes
Consumption processing is carried out with " handler " method.
Message queue unifies consumer client 120 in startup or running, can be according to the Consumption relation of subscription
Data and its change events, the dynamic consumer's example for creating, deleting, changing program internal maintenance.Wherein, message queue is united
One consumer client 120 can subscribe to father node path, increase when having child node path and child node content in configuration center 140
When adding, delete, changing, the program that change message queue is unified in consumer client 120 can safeguard that corresponding consumer is real
Example.
The technical scheme of the present embodiment, by deployment configuration center 140 by Connecting quantity information and Consumption relation data this
A little subscribing relationship data are unified in consumer client 120 to pull out from message queue to be come, and is convenient to the unified consumption of message queue
The maintenance variation of person's client Program.
Preferably, the consumption system, in addition to:
Consumer calls agency service 150, is connected to the message queue and unifies consumer client 120 and the consumption
Between person's service 130, for as act on behalf of adaptation layer aid in the customer service 130 to receive the message queue is unified to be consumed
The message data that person's client 120 is distributed.
Wherein, it is customer service 130 as another information consumption processing logic that consumer, which calls agency service 150,
Extension, possess all characteristics of customer service 130.Specifically, when consumer calls agency service 150 to receive message queue system
After the message data of one client 120 distribution, consumer can be called to call 150 local logic of agency service or script processing
Message data, it can also be used as and act on behalf of the adaptation layer auxiliary reception message data of customer service 130, call customer service 130
Handle message.
The technical scheme of the present embodiment, by calling consumer to call agency service 150 can be to the consumption of message data
Process is adapted to and reused, and is met and is opened and closed principle above design pattern.Meanwhile reduce the cost of switching consumption pattern.
Exemplarily, as shown in Figure 1B, message queue unifies the connection that consumer client obtains subscription from configuration center
Parameter information;According to the message data subscribed in above-mentioned Connecting quantity information connection message queue server cluster;According to from
The determination of Consumption relation data and the message data institute obtained from Message Queuing server's cluster for putting the subscription of center acquisition are right
The customer service answered and/or customer agent's service;By the message data of acquisition be distributed to corresponding to customer service and/or
Customer agent services.
On the basis of the technical scheme of above-mentioned each embodiment, it is preferable that Message Queuing server's cluster 110 to
It is one less;
The message queue unifies consumer client 120 and is at least one;Each message queue unifies consumer
Client 120 is connected with one or more Message Queuing server's clusters 110, and the different message queues unify consumer client
Message Queuing server's cluster 110 that end 120 is connected is identical or different.
In same group message queue server cluster 110, multiple message queues can be disposed and unify consumer client
120, each message queue unifies consumer's example of the establishment of consumer client 120 by subscribing to the difference of configuration center 140
Father node path, and increase in configuration center 140, the child node path that is deleted or modified and child node content, get
The Consumption relation data of different grouping.Now, different message queues, which unifies consumer client 120, can consume different numbers
It is believed that breath, realizes the horizontal fractionation of same Message Queuing server's cluster 110.
Exemplary, as shown in Figure 1 C, division configuration is carried out according to service line, message queue unifies consumer client A
The Consumption relation number of the related theme/queue of all orders is got from configuration center (can be Zookeeper clusters)
According to the Consumption relation Groups List of composition;Message queue unify consumer client B from configuration center (can be Zookeeper collection
Group) in get the related theme/queue of all user Consumption relation data composition Consumption relation Groups List;Message team
The unified consumer client C of row can also subscribe to message queue when subscribing to the message data in Message Queuing server's cluster 2
Message data in server cluster 1, serve effect more living.
At the same time it can also unify the multiple Message Queuing servers of deployment in consumer client 120 in a message queue
Cluster 110.That is, identical message queue unifies the different message queue clothes of connection that consumer client 120 can be parallel
Business device cluster.Now, message queue, which unifies consumer client 120, both can only subscribe to a certain Message Queuing server's cluster
110 message data, disappearing for other Message Queuing server's clusters 110 can also be subscribed to simultaneously as backup or parallel consumption terminal
Cease data.
Exemplarily, as shown in Figure 1 C, Message Queuing Services can be disposed in the case where message queue unifies consumer client C
Device cluster I and Message Queuing server cluster II;Unify consumer client A in message queue and message queue unifies consumer
Message Queuing server cluster I can be disposed under customer end B.By way of being cross-deployed, same message team can have both been subscribed to
The message data of Message Queuing server's cluster under the unified consumer client of row, can also be used as backup or parallel consumption terminal
The message data of multiple Message Queuing server's clusters is subscribed to simultaneously.
It should be noted that in fig. 1 c, any message queue unify consumer client can according to its own from
The Consumption relation data for the subscription that configuration center obtains determine the message data institute with being obtained from Message Queuing server's cluster
Corresponding customer service and/or customer agent service;By the message data of acquisition be distributed to corresponding to customer service and/
Or customer agent's service.Each message queue unifies consumer client and calls agency with customer service and/or consumer
The annexation of service is identical with Figure 1B, eliminates related content in fig. 1 c.The technical scheme of the present embodiment, by same
The mode that the horizontal fractionation of Message Queuing server's cluster 110 and different messages queue server cluster 110 are cross-deployed, is played
The effects of more work.
Embodiment two
Fig. 2 is a kind of message queue consuming method schematic flow sheet that the embodiment of the present invention two provides, and the present embodiment can fit
For the situation for the message data for consuming message queue, this method can be by the message queue in the consumption system in embodiment one
Unify consumer client to perform, specifically include following steps:
Step 210, the consumer's example being pre-created by operation, with Message Queuing server's cluster foundation connection;
Wherein, included in consumer's example and unify consumer client's tool in Message Queuing server's cluster with message queue
There is the Connecting quantity information of the corresponding Message Queuing server of message data subscribing relationship, and have with the message data of acquisition
The corresponding customer service and/or consumer of standby incidence relation call the parameter information of agency service.
Step 220, after connection is established with Message Queuing server's cluster, obtain the Message Queuing server of subscription
The message data of message queue storage in cluster;
Wherein, after message queue, which unifies consumer client, is that Message Queuing server's cluster establishes connection,
If the message data for obtaining the message queue storage in the Message Queuing server's cluster subscribed to is unsuccessful, can be according to corresponding
Message queue provide reconnection mechanism, reconnect corresponding message queue and obtain the message data of subscription.
Step 230, the distribution message data to corresponding customer service and/or consumer call agency service.
Wherein, when dispatch messages data call agency service to fail to corresponding customer service and/or consumer, disappear
Consumer client is unified in breath queue to be fed back to the configured information that consume failure and disappear corresponding to Message Queuing server's cluster
Cease queue server.Now, message queue, which unifies consumer client, to be consumed again according to the processing strategy of message queue
Breath data skip this time consumption, carry out the consumption of next message data.
The technical scheme of the present embodiment, consumer client is unified by message queue and runs the consumer being pre-created reality
Example, with Message Queuing server's cluster foundation connection, message data is therefrom obtained, and the message data of acquisition is distributed to correspondingly
Customer service and/or consumer call agency service, realize the consumption of message data in message queue.Solve change to disappear
Breath queue product the problem of being made troubles to user, realize the business logic codes in customer service and message queue
Application programming interfaces decouple, and reduce the exploitation maintenance difficulties brought due to message queue change of product, while reduce user's throwing
The energy and cost entered.
Preferably, before consumer's example that operation is pre-created, in addition to:
Subscribe to and preserve the Connecting quantity information of configuration center issue;
Preferably, by running the consumer's example being pre-created, with Message Queuing server's cluster foundation connection, bag
Include:
Run consumer's example for being pre-created, in the running of consumer's example, reading and saving it is described
Connecting quantity information;
Established and connected according to the Connecting quantity information and Message Queuing server's cluster;
Obtain the message data of the message queue storage in the Message Queuing server's cluster subscribed to;
Distribute the message data to corresponding customer service and/or consumer's calling agency service;
Preferably, also include when subscribing to and preserving the Connecting quantity information of configuration center issue:
Subscribe to and preserve the Consumption relation data of configuration center issue;
Preferably, the distribution message data calls agency service to corresponding customer service and/or consumer,
Including:
The Consumption relation data of reading and saving, the message data for determining to obtain according to the Consumption relation data is with disappearing
The incidence relation of the person's of expense service;
Customer service corresponding to the message data of acquisition is distributed to according to the incidence relation or corresponding to being distributed to
The consumer that customer service is connected calls agency service.
Embodiment three
A kind of preferable message queue consuming method schematic flow sheet that Fig. 3 provides for the embodiment of the present invention three, this implementation
Example is applicable to consume the situation of the message data of message queue.The present embodiment has been carried out further on the basis of embodiment two
Optimization.Specifically include following steps:
Step 310, the Connecting quantity information and Consumption relation data subscribed to and preserve configuration center issue;
Wherein, message queue unifies consumer client and subscribed to from configuration center respectively to disappear in Message Queuing server's cluster
Cease the Connecting quantity information of queue server.Connecting quantity information comprises at least each message queue in Message Queuing server's cluster
The IP lists of server, the other specification information that Connecting quantity packet contains are relevant with the specific message queue product selected.Root
Different according to Message Queuing server's cluster product type of deployment, the content that Connecting quantity packet contains also differs.It is exemplary
Ground, Connecting quantity information can also include user's list of file names, cipher list etc..
Exemplarily, configuration center can be Zookeeper clusters, can also select other programs.
Exemplarily, when disposing Zookeeper clusters as configuration center, the configuration information of Connecting quantity information therein
Including at least node content and node path.Wherein, node content can be " { " broker.ips ":"192.168.10.81:
61616 " form } ", it is corresponding for storing some Message Queuing server in Message Queuing server's cluster 110 to be connected
IP address.Node path can be "/mq/server/info " form, for representing node content in configuration center
Specific store path.Specifically, when message queue unifies the Connecting quantity information in consumer client's acquisition configuration center, root
Node content is obtained according to above-mentioned node path.Message queue unifies consumer client according to the IP in the node content of acquisition
Location, establish and connect with corresponding Message Queuing server, for subsequently obtaining the message data subscribed to.
Preferably, message queue unifies the data that consumer client can monitor the Connecting quantity information of configuration center in real time
Whether change.The Connecting quantity information of node path is specified due to increasing, being deleted or modified when listening in configuration center
When being changed Deng operation, the corresponding data for the preservation that message queue is unified in consumer client will change, and then
Above-mentioned change can be dynamically embodied on corresponding consumer's example.
Wherein, in Consumption relation data comprise at least subscribe to Message Queuing server's cluster in message data theme or
Customer service's information that queue, needs call.Wherein, customer service's information can be the title of customer service, version,
Packet, specific method, interface or function name etc..Certainly, Consumption relation data can also need to increase other according to realization
Parameter, any restriction is not done herein.
Exemplarily, configuration center can be Zookeeper clusters, can also select other programs.
Exemplarily, when disposing Zookeeper clusters as configuration center, the configuration information of Consumption relation data therein
Including at least father node path, child node path and child node content.Wherein, father node path can be "/mq/biz/
MqClient " form, for representing the directory information of memory node content;Child node path can be "/mq/biz/
MqClient/business_1 " form, for representing the inventory information of storage child node content;Child node content can
To be " { " concurrent example number ":2, " functional circuit information ":" consulting, " director " are replied in customer service:" Xiao Ming, king are small
Two ", " method name of processing ":" handler ", " service name of processing ":"
Xxx.xxx.xx.xx.processService ", " service packet of processing ":" * ", " consumption group ":" card ", " topic ":
[{"topic":" ADVICE_REPLY_MAI " }], " service release ":" 1.0.0 " } " form, for represent message data with
Incidence relation between corresponding customer service.Message queue unifies consumer client in startup or running, can
With the Consumption relation data and its change events according to subscription, the dynamic consumer for creating, deleting, changing program internal maintenance
Example.Wherein, message queue, which unifies consumer client, can subscribe to father node path, when having in child node path and child node
When appearance increase, deletion, modification, the program that change message queue is unified in consumer client can safeguard that corresponding consumer is real
Example.
Consumer's example that step 320, operation are pre-created, in the running of consumer's example, read and protect
The Connecting quantity information deposited;
Step 330, established and connected according to the Connecting quantity information and Message Queuing server cluster;
Exemplarily, when message queue unify consumer client obtain configuration center in Connecting quantity information it is unsuccessful
When, it is impossible to established and connected according to the Connecting quantity information and Message Queuing server's cluster, cause that disappearing for this can not be created
The person's of expense example.
Step 340, obtain the message data that the message queue in the Message Queuing server's cluster subscribed to stores;
Wherein, after message queue, which unifies consumer client, is that Message Queuing server's cluster establishes connection,
If the message data for obtaining the message queue storage in the Message Queuing server's cluster subscribed to is unsuccessful, can be according to corresponding
Message queue provide reconnection mechanism, reconnect corresponding message queue and obtain the message data of subscription.
Step 350, the Consumption relation data of reading and saving, the message for determining to obtain according to the Consumption relation data
Data and the incidence relation of customer service;
Step 360, according to the incidence relation message data of acquisition is distributed to corresponding to customer service or distribution
Agency service is called to the consumer that corresponding customer service is connected.
Wherein, when dispatch messages data call agency service to fail to corresponding customer service and/or consumer, disappear
Consumer client is unified in breath queue to be fed back to the configured information that consume failure and disappear corresponding to Message Queuing server's cluster
Cease queue server.Now, message queue, which unifies consumer client, to be consumed again according to the processing strategy of message queue
Breath data skip this time consumption, carry out the consumption of next message data.
The technical scheme of the present embodiment, by subscribing to the Connecting quantity information prestored in configuration center and message queue
Server cluster establishes a connection, and reads corresponding message data;The consumption prestored by subscribing in configuration center
Relation data, above-mentioned message data is distributed to corresponding customer service and/or consumer and called in service.The technical side
The beneficial effect of case is:Only related to the Message Queuing server cluster program of whole process of consumption only has message queue uniformly
Consumer client, facilitate follow-up upgrading and transformation;Connecting quantity information and Consumption relation data is unified from message queue
Consumer's example procedure of consumer client, which collects to pull out, to be come, and facilitates the maintenance variation of business development personnel;By business generation
The application programming interfaces separation of code logical AND Message Queuing server, solve change message queue product makes troubles to user
The problem of;Set customer agent to service existing consumption mode is adapted to out, consumption can be reused to greatest extent
Code.The technical scheme of the present embodiment reduces the exploitation maintenance difficulties brought due to message queue change of product, reduces simultaneously
The energy and cost of user's input, not only go for the information consumption of the message queue under general conventional software architectural pattern
The information consumption of pattern, the message queue being also applied under serviceization framework.
Example IV
Fig. 4 is a kind of structural representation for message queue consumption device that the embodiment of the present invention four provides.The device includes:
Link block 410, acquisition module 420 and distribution module 430.
Wherein, link block 410, for by running the consumer's example being pre-created, collecting with Message Queuing server
Group establishes connection;
Acquisition module 420, for after connection is established with Message Queuing server's cluster, obtaining the message team of subscription
The message data of message queue storage in row server cluster;
Distribution module 430, for distributing the message data to corresponding customer service and/or consumer calling agency
Service.
The technical scheme of the present embodiment, the consumer's example being pre-created is run by link block 410, with message queue
Server cluster establishes a connection;Message team in the Message Queuing server's cluster subscribed to is obtained by acquisition module 420
Arrange the message data of storage;The message data is distributed to corresponding customer service and/or consumer by distribution module 430
Agency service is called, realizes the information consumption process of message queue.Now, the business logic codes in customer service independent of
In any program code or bag related to Message Queuing server cluster, solve change message queue product and brought to user
The problem of inconvenient, realize and decouple the application programming interfaces of the business logic codes in customer service and message queue, drop
The low exploitation maintenance difficulties brought due to message queue change of product, while reduce the energy and cost of user's input.
Preferably, said apparatus also includes:
Preserving module 440 is subscribed to, for subscribing to and preserving the Connecting quantity information of configuration center issue;
Preferably, the link block 410, including:
Running unit, for running the consumer's example being pre-created, in the running of consumer's example, read
Go bail for the Connecting quantity information deposited;
Connection unit, connected for being established according to the Connecting quantity information and Message Queuing server's cluster.
Preferably, the subscription preserving module 440, it is additionally operable to subscribe to and preserves the Consumption relation number of configuration center issue
According to;
Preferably, the distribution module 430, including:
Determining unit, for the Consumption relation data of reading and saving, determine to obtain according to the Consumption relation data
Message data and customer service incidence relation;
Dispatching Unit, for customer service corresponding to the message data of acquisition is distributed to according to the incidence relation or
The consumer that customer service corresponding to being distributed to is connected calls agency service.
Above-mentioned message queue consumption device can perform the message queue consuming method that any embodiment of the present invention is provided, tool
It is standby to perform the corresponding functional module of message queue consuming method and beneficial effect.
Pay attention to, above are only presently preferred embodiments of the present invention and institute's application technology principle.It will be appreciated by those skilled in the art that
The invention is not restricted to specific embodiment described here, can carry out for a person skilled in the art various obvious changes,
Readjust and substitute without departing from protection scope of the present invention.Therefore, although being carried out by above example to the present invention
It is described in further detail, but the present invention is not limited only to above example, without departing from the inventive concept, also
Other more equivalent embodiments can be included, and the scope of the present invention is determined by scope of the appended claims.
Claims (10)
- A kind of 1. message queue consumption system, it is characterised in that including:Message Queuing server's cluster, for storing message data;Message queue unifies consumer client, for the consumer's example being pre-created by operation, with the message queue Server cluster establishes connection, and obtains and distribute the message queue in Message Queuing server's cluster of subscription and store Message data;Customer service, unify consumer client with the message queue and be connected, for receiving and handling the message queue The message data of unified consumer client's distribution.
- 2. consumption system according to claim 1, it is characterised in that also include:Configuration center, unify consumer client with the message queue and be connected, for issuing the Connecting quantity being pre-configured with letter Breath and Consumption relation data to the message queue unify consumer client;Wherein, the message queue unifies consumer client according to the Connecting quantity information and the Message Queuing server Cluster establishes a connection;The message data of acquisition and associating for customer service are determined according to the Consumption relation data System, and the message data of acquisition is distributed to by corresponding customer service according to the incidence relation.
- 3. consumption system according to claim 1 or 2, it is characterised in that also include:Consumer calls agency service, be connected to the message queue unify consumer client and the customer service it Between, for unifying consumer client's distribution as acting on behalf of adaptation layer and aid in the customer service to receive the message queue The message data.
- 4. consumption system according to claim 3, it is characterised in that Message Queuing server's cluster is at least one It is individual;The message queue unifies consumer client and is at least one;Each message queue unify consumer client with One or more Message Queuing server's clusters are connected, the different message queues unify consumer client connected it is described Message Queuing server's cluster is identical or different.
- A kind of 5. message queue consuming method, it is characterised in that including:By running the consumer's example being pre-created, with Message Queuing server's cluster foundation connection;After connection is established with Message Queuing server's cluster, the message in Message Queuing server's cluster of subscription is obtained The message data of queue storage;Distribute the message data to corresponding customer service and/or consumer's calling agency service.
- 6. consuming method according to claim 5, it is characterised in that before consumer's example that operation is pre-created, Also include:Subscribe to and preserve the Connecting quantity information of configuration center issue;It is described to establish and connect with Message Queuing server cluster by running consumer's example for being pre-created, including:Run the consumer's example being pre-created, in the running of consumer's example, the connection of reading and saving Parameter information, established and connected according to the Connecting quantity information and Message Queuing server's cluster.
- 7. consuming method according to claim 6, it is characterised in that subscribing to and preserving the connection ginseng of configuration center issue Also include during number information:Subscribe to and preserve the Consumption relation data of configuration center issue;It is described to distribute the message data to corresponding customer service and/or consumer's calling agency service, including:The Consumption relation data of reading and saving, message data and the consumer for determining to obtain according to the Consumption relation data The incidence relation of service, and customer service or distribution corresponding to according to the incidence relation, the message data of acquisition is distributed to Agency service is called to the consumer that corresponding customer service is connected.
- A kind of 8. message queue consumption device, it is characterised in that including:Link block, for the consumer's example being pre-created by operation, with Message Queuing server's cluster foundation connection;Acquisition module, for after connection is established with Message Queuing server's cluster, obtaining the Message Queuing Services of subscription The message data of message queue storage in device cluster;Distribution module, for distributing the message data to corresponding customer service and/or consumer's calling agency service.
- 9. consumption device according to claim 8, it is characterised in that also include:Preserving module is subscribed to, for subscribing to and preserving the Connecting quantity information of configuration center transmission;The link block, including:Running unit, for running the consumer's example being pre-created, in the running of consumer's example, read and protect The Connecting quantity information deposited;Connection unit, connected for being established according to the Connecting quantity information and Message Queuing server's cluster.
- 10. consumption device according to claim 9, it is characterised in that the subscription preserving module is additionally operable to subscribe to and protected Deposit the Consumption relation data of configuration center issue;The distribution module, including:Determining unit, for the Consumption relation data of reading and saving, determine that what is obtained disappears according to the Consumption relation data Cease data and the incidence relation of customer service;Dispatching Unit, for customer service or distribution corresponding to the message data of acquisition is distributed to according to the incidence relation Agency service is called to the consumer that corresponding customer service is connected.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710624568.4A CN107395729A (en) | 2017-07-27 | 2017-07-27 | A kind of consumption system of message queue, method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710624568.4A CN107395729A (en) | 2017-07-27 | 2017-07-27 | A kind of consumption system of message queue, method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107395729A true CN107395729A (en) | 2017-11-24 |
Family
ID=60341705
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710624568.4A Pending CN107395729A (en) | 2017-07-27 | 2017-07-27 | A kind of consumption system of message queue, method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107395729A (en) |
Cited By (23)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108279988A (en) * | 2018-01-25 | 2018-07-13 | 微梦创科网络科技(中国)有限公司 | A kind of message treatment method and system based on Lua scripts |
CN109660607A (en) * | 2018-12-05 | 2019-04-19 | 北京金山云网络技术有限公司 | A kind of service request distribution method, method of reseptance, device and server cluster |
CN109783253A (en) * | 2018-12-28 | 2019-05-21 | 南京唯实科技有限公司 | Distributed message data/address bus based on kafka |
CN109815028A (en) * | 2018-12-27 | 2019-05-28 | 北京摩拜科技有限公司 | Data synchronous system, method, apparatus and computer storage medium |
CN110300067A (en) * | 2019-06-26 | 2019-10-01 | 深圳前海微众银行股份有限公司 | Queue regulation method, device, equipment and computer readable storage medium |
CN110515749A (en) * | 2019-08-30 | 2019-11-29 | 深圳乐信软件技术有限公司 | Method, apparatus, server and the storage medium for the queue scheduling that information is sent |
CN110532105A (en) * | 2018-05-25 | 2019-12-03 | 优信拍(北京)信息科技有限公司 | A kind of control method, system and the device of message queue consumer process |
CN110740145A (en) * | 2018-07-18 | 2020-01-31 | 北京京东尚科信息技术有限公司 | Message consumption method, device, storage medium and electronic equipment |
CN110798495A (en) * | 2018-08-03 | 2020-02-14 | 北京京东尚科信息技术有限公司 | Method and server for end-to-end message push in cluster architecture mode |
CN110827958A (en) * | 2019-11-01 | 2020-02-21 | 越亮传奇科技股份有限公司 | Medical image data timely acquisition system and method |
CN111083066A (en) * | 2018-10-19 | 2020-04-28 | 北京奇虎科技有限公司 | Internet of things system, equipment message transfer method and device |
CN111240860A (en) * | 2020-01-07 | 2020-06-05 | 广州虎牙科技有限公司 | Message processing method and service system |
CN111459689A (en) * | 2020-04-07 | 2020-07-28 | 中国建设银行股份有限公司 | Message processing system and method based on distributed queue |
CN111711675A (en) * | 2020-06-08 | 2020-09-25 | 广东赛博威信息科技有限公司 | Solution for concurrent message transmission in local area network |
CN111858007A (en) * | 2020-07-29 | 2020-10-30 | 广州海鹚网络科技有限公司 | Task scheduling method and device based on message middleware |
CN112052093A (en) * | 2020-09-08 | 2020-12-08 | 哈尔滨工业大学 | Experimental big data resource allocation management system based on message queue technology |
CN112291082A (en) * | 2020-09-30 | 2021-01-29 | 北京大米科技有限公司 | Computer room disaster recovery processing method, terminal and storage medium |
CN112445625A (en) * | 2019-08-27 | 2021-03-05 | 北京国双科技有限公司 | Data processing method and device |
CN112882846A (en) * | 2021-02-19 | 2021-06-01 | 深圳市云网万店科技有限公司 | Data processing method and device of message queue, computer equipment and storage medium |
CN112968911A (en) * | 2021-03-31 | 2021-06-15 | 中国工商银行股份有限公司 | Data broadcasting method and device |
CN113254466A (en) * | 2021-06-18 | 2021-08-13 | 腾讯科技(深圳)有限公司 | Data processing method and device, electronic equipment and storage medium |
CN113419882A (en) * | 2021-08-24 | 2021-09-21 | 成都特维思科技有限公司 | Method for dynamically switching message queue |
CN113626211A (en) * | 2021-06-29 | 2021-11-09 | 欧电云信息科技(江苏)有限公司 | Switching method and switching system of message queue, electronic equipment and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104092767A (en) * | 2014-07-21 | 2014-10-08 | 北京邮电大学 | Posting/subscribing system for adding message queue models and working method thereof |
US20150200887A1 (en) * | 2014-01-14 | 2015-07-16 | International Business Machines Corporation | Message switch file sharing |
CN105183470A (en) * | 2015-09-06 | 2015-12-23 | 东南大学 | Natural language processing systematic service platform |
-
2017
- 2017-07-27 CN CN201710624568.4A patent/CN107395729A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150200887A1 (en) * | 2014-01-14 | 2015-07-16 | International Business Machines Corporation | Message switch file sharing |
CN104092767A (en) * | 2014-07-21 | 2014-10-08 | 北京邮电大学 | Posting/subscribing system for adding message queue models and working method thereof |
CN105183470A (en) * | 2015-09-06 | 2015-12-23 | 东南大学 | Natural language processing systematic service platform |
Cited By (34)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108279988B (en) * | 2018-01-25 | 2021-07-23 | 微梦创科网络科技(中国)有限公司 | Message processing method and system based on Lua script language |
CN108279988A (en) * | 2018-01-25 | 2018-07-13 | 微梦创科网络科技(中国)有限公司 | A kind of message treatment method and system based on Lua scripts |
CN110532105B (en) * | 2018-05-25 | 2022-06-17 | 优信拍(北京)信息科技有限公司 | Method, system and device for controlling message queue consumer process |
CN110532105A (en) * | 2018-05-25 | 2019-12-03 | 优信拍(北京)信息科技有限公司 | A kind of control method, system and the device of message queue consumer process |
CN110740145B (en) * | 2018-07-18 | 2023-08-08 | 北京京东尚科信息技术有限公司 | Message consumption method and device, storage medium and electronic equipment |
CN110740145A (en) * | 2018-07-18 | 2020-01-31 | 北京京东尚科信息技术有限公司 | Message consumption method, device, storage medium and electronic equipment |
CN110798495B (en) * | 2018-08-03 | 2023-05-30 | 北京京东尚科信息技术有限公司 | Method and server for end-to-end message push in cluster architecture mode |
CN110798495A (en) * | 2018-08-03 | 2020-02-14 | 北京京东尚科信息技术有限公司 | Method and server for end-to-end message push in cluster architecture mode |
CN111083066A (en) * | 2018-10-19 | 2020-04-28 | 北京奇虎科技有限公司 | Internet of things system, equipment message transfer method and device |
CN111083066B (en) * | 2018-10-19 | 2022-04-29 | 北京奇虎科技有限公司 | Internet of things system, equipment message transfer method and device |
CN109660607A (en) * | 2018-12-05 | 2019-04-19 | 北京金山云网络技术有限公司 | A kind of service request distribution method, method of reseptance, device and server cluster |
CN109815028A (en) * | 2018-12-27 | 2019-05-28 | 北京摩拜科技有限公司 | Data synchronous system, method, apparatus and computer storage medium |
CN109783253A (en) * | 2018-12-28 | 2019-05-21 | 南京唯实科技有限公司 | Distributed message data/address bus based on kafka |
CN110300067B (en) * | 2019-06-26 | 2022-02-08 | 深圳前海微众银行股份有限公司 | Queue adjusting method, device, equipment and computer readable storage medium |
CN110300067A (en) * | 2019-06-26 | 2019-10-01 | 深圳前海微众银行股份有限公司 | Queue regulation method, device, equipment and computer readable storage medium |
CN112445625A (en) * | 2019-08-27 | 2021-03-05 | 北京国双科技有限公司 | Data processing method and device |
CN110515749A (en) * | 2019-08-30 | 2019-11-29 | 深圳乐信软件技术有限公司 | Method, apparatus, server and the storage medium for the queue scheduling that information is sent |
CN110827958B (en) * | 2019-11-01 | 2023-04-25 | 越亮传奇科技股份有限公司 | Medical image data timely acquisition system and method |
CN110827958A (en) * | 2019-11-01 | 2020-02-21 | 越亮传奇科技股份有限公司 | Medical image data timely acquisition system and method |
CN111240860A (en) * | 2020-01-07 | 2020-06-05 | 广州虎牙科技有限公司 | Message processing method and service system |
CN111240860B (en) * | 2020-01-07 | 2023-09-08 | 广州虎牙科技有限公司 | Message processing method and service system |
CN111459689A (en) * | 2020-04-07 | 2020-07-28 | 中国建设银行股份有限公司 | Message processing system and method based on distributed queue |
CN111711675A (en) * | 2020-06-08 | 2020-09-25 | 广东赛博威信息科技有限公司 | Solution for concurrent message transmission in local area network |
CN111711675B (en) * | 2020-06-08 | 2023-04-07 | 广东赛博威信息科技有限公司 | Solution for concurrent message transmission in local area network |
CN111858007A (en) * | 2020-07-29 | 2020-10-30 | 广州海鹚网络科技有限公司 | Task scheduling method and device based on message middleware |
CN112052093A (en) * | 2020-09-08 | 2020-12-08 | 哈尔滨工业大学 | Experimental big data resource allocation management system based on message queue technology |
CN112291082A (en) * | 2020-09-30 | 2021-01-29 | 北京大米科技有限公司 | Computer room disaster recovery processing method, terminal and storage medium |
CN112882846A (en) * | 2021-02-19 | 2021-06-01 | 深圳市云网万店科技有限公司 | Data processing method and device of message queue, computer equipment and storage medium |
CN112882846B (en) * | 2021-02-19 | 2024-02-09 | 深圳市云网万店科技有限公司 | Data processing method and device for message queue, computer equipment and storage medium |
CN112968911B (en) * | 2021-03-31 | 2022-09-09 | 中国工商银行股份有限公司 | Data broadcasting method and device |
CN112968911A (en) * | 2021-03-31 | 2021-06-15 | 中国工商银行股份有限公司 | Data broadcasting method and device |
CN113254466A (en) * | 2021-06-18 | 2021-08-13 | 腾讯科技(深圳)有限公司 | Data processing method and device, electronic equipment and storage medium |
CN113626211A (en) * | 2021-06-29 | 2021-11-09 | 欧电云信息科技(江苏)有限公司 | Switching method and switching system of message queue, electronic equipment and storage medium |
CN113419882A (en) * | 2021-08-24 | 2021-09-21 | 成都特维思科技有限公司 | Method for dynamically switching message queue |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107395729A (en) | A kind of consumption system of message queue, method and device | |
US10552448B2 (en) | Systems and methods for event driven object management and distribution among multiple client applications | |
CN111091429B (en) | Electronic bill identification distribution method and device and electronic bill generation system | |
CN109756366A (en) | System is realized in intelligent network SCP cloud service based on CAAS | |
CN104579905B (en) | Message delivery method and system and MOM servers, receiving terminal | |
CN107222530A (en) | Service asynchronous exchange method, equipment, system and computer-readable recording medium | |
CN107357571A (en) | Maintaining method, system and the component server of apparatus assembly program | |
CN112463211A (en) | System architecture transformation method compatible with multiple development architectures and system architecture | |
CN102387075A (en) | Dynamic service routing method and device for enterprise service bus | |
CN102710593A (en) | Method, device and system for publishing message in graph mashup | |
CN110287266A (en) | A kind of distributed system and data processing method | |
CN111784329A (en) | Service data processing method and device, storage medium and electronic device | |
CN111813503A (en) | Micro-service application open system based on container cloud | |
CN116489214A (en) | Unified service scheduling method, device, medium and equipment based on micro service gateway | |
CN116319732A (en) | Message queue centralized configuration management system and method based on RabbitMQ | |
CN103701720A (en) | Communication method with Socket server and online transaction management system | |
JP3197279B2 (en) | Business takeover system | |
US8874798B2 (en) | Aspect oriented application of a mediator in an enterprise service bus (ESB) of a service oriented architected data processing system | |
CN112328406A (en) | Micro-service distributed transaction system based on TCC (transmission control center) and service processing method | |
CN110515991A (en) | Batch dispenses the collection method and device, storage medium, terminal of file | |
CN106357735B (en) | For operating the method and apparatus of the infrastructure layer of cloud computing framework | |
JPH0392942A (en) | Storing method and accessing method for file | |
CN109271259A (en) | Enterprise Service Bus system, data processing method, terminal and storage medium | |
JP2003303120A (en) | Data backup method and system for implementing the same method | |
CN113127292A (en) | Operation, maintenance and monitoring method suitable for multi-cloud management |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171124 |
|
RJ01 | Rejection of invention patent application after publication |