CN109710435A - A kind of message delivery method based on the more message queues of support - Google Patents
A kind of message delivery method based on the more message queues of support Download PDFInfo
- Publication number
- CN109710435A CN109710435A CN201910004710.4A CN201910004710A CN109710435A CN 109710435 A CN109710435 A CN 109710435A CN 201910004710 A CN201910004710 A CN 201910004710A CN 109710435 A CN109710435 A CN 109710435A
- Authority
- CN
- China
- Prior art keywords
- message
- queue
- consumer
- adapter
- information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000002716 delivery method Methods 0.000 title claims abstract description 27
- 239000011230 binding agent Substances 0.000 claims abstract description 38
- 238000005538 encapsulation Methods 0.000 claims abstract description 9
- 238000012545 processing Methods 0.000 claims description 12
- 239000012141 concentrate Substances 0.000 claims description 6
- 238000007726 management method Methods 0.000 claims description 6
- 238000012544 monitoring process Methods 0.000 claims description 5
- 230000006978 adaptation Effects 0.000 claims description 4
- 230000005856 abnormality Effects 0.000 claims description 3
- 230000005540 biological transmission Effects 0.000 claims description 3
- 230000000977 initiatory effect Effects 0.000 claims 1
- 238000010586 diagram Methods 0.000 description 5
- 238000000034 method Methods 0.000 description 4
- 230000002159 abnormal effect Effects 0.000 description 2
- 239000003999 initiator Substances 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Abstract
The present invention is more particularly directed to a kind of based on the message delivery method for supporting more message queues.This is adapted to, including adapter Adapter and different types of message queue connector Binder two parts based on the message delivery method for supporting more message queues by client of the adapter Adapter to each message queue;The connector Binder indicates the encapsulation to a certain message queue client, further encapsulation of the adapter Adapter to connector Binder, so that message is sent and message sink execution does not perceive the type of message queue.This calls that simple, scalability is strong based on the message delivery method for supporting more message queues, and user does not need the service type for being concerned about specific message queue, and when replacing Message Queuing Services, does not need to change layer identification code, have good application value.
Description
Technical field
It is the present invention relates to computer software cloud computing, micro services technical field, in particular to a kind of based on the more message of support
The message delivery method of queue.
Background technique
The main application scenarios of message queue include: peak load shifting, improve the performance of system;System decoupling facilitates extension;
The interaction between different service end units is realized in asynchronous communication;Reliable news guarantees data final consistency etc..
In fields such as cloud computing, micro services, message queue is widely used in various scenes, however for different
Scene, applicable message queue type is also different, for example, for calling frequent, high concurrent but allowing a small amount of information drop-out
Log recording scene, Kafka are applicable in the most;For safety, the demanding payment scene of message integrity, RabbitMQ or
RocketMQ is more applicable in.But traditional EventBus is the encapsulation to a kind of message queue, can not be suitable for simultaneously
In product using a variety of message queues.There is provided it is a kind of based on support the message delivery method of more message queues be very it is necessary to
's.
Based on the above situation, the invention proposes a kind of based on the message delivery method for supporting more message queues, passes through
Adapter is adapted to the client of each message queue, it is intended to so that the sender of message and the recipient of message offset
The type of breath queue does not perceive.
Summary of the invention
In order to compensate for the shortcomings of the prior art, the present invention provides it is a kind of be simple and efficient based on supporting more message queues
Message delivery method.
The present invention is achieved through the following technical solutions:
A kind of message delivery method based on the more message queues of support, it is characterised in that: by adapter Adapter to each
The client of a message queue is adapted to, including adapter Adapter and different types of message queue connector Binder
Two parts;The connector Binder indicates the encapsulation to a certain message queue client, and the adapter Adapter is to even
The further encapsulation of device Binder is connect, so that message is sent and message sink execution does not perceive the type of message queue;It is described
Adapter Adapter includes the adapter Adapter that message sends, receives and consumes, the adapter that consumer subscribes to, monitors
Adapter, total connection pool management and consumer organize management, and reserve expansible interface, facilitate and increase different connectors
Adaptation when Binder, to different types of messages queue.
The present invention is based on the message delivery methods for supporting more message queues, comprising the following steps:
(A) user creates queue essential information, consumer's essential information, the subscribing relationship between queue and consumer;
(B) user enables poll and monitors service, subscribes to consumer, and monitor queue;
(C) user calls message to send api interface and sends message;
(D) poll monitoring service, which receives after user is sent to message, calls message to execute program progress information consumption.
In the step (A), the transmitting terminal of message and the receiving end of message can separate and dispose, and the message sending end is
The initiator that message is sent;Message sink end is the side that message sink executes;Message sender and message receiver can portions
Administration is in the different service units of micro services system;The essential information of queue, consumer information, between queue and consumer
Relationship is to concentrate deployment;The essential information of queue includes queued name, the mark letter of Binder belonging to queue description and queue
Breath;Message person's information includes the programmed logic that information consumption executes, and Binder belonging to consumer and information consumption execute failure
Or abnormal processing strategie;Subscribing relationship mainly includes the mark of queue, consumer identification and routing iinformation.
In the step (B), poll services are disposed in each service unit, are touched automatically when service unit enables
Send out the enabling of poll services;When poll services enable, the time interval of poll is obtained in configuration center first, then when each
Between interval reach after obtain this service unit from caching or configuration center database and need the consumer information subscribed to.
Data in the caching can periodically update, per acquisition message person's information from configuration center at regular intervals,
And update caching;After monitoring service acquisition to the consumer information for needing to subscribe to, it is active to check whether consumer has
Connection object be connected to for connector Binder server-side, Connection pairs is re-created if not
As, and guarantee that one and only one Connection object of the consumer of each subscription is connected to Binder to server-side.
Per supporting a kind of message queue type, need to increase a kind of connector Binder to the client of the message queue more
It is packaged;It is logical between Message Queuing Services corresponding with Binder end that the Connection object indicates that consumer subscribes to
Road.
In the step (C), according to the subscribing relationship of queue and consumer in configuration center, message entity is sent to
Corresponding consumer subscribes to;User calls message to send api interface and sends message, then obtains the transmission Connection of creation
Object, by adapter Adapter transmit the message to for connector Binder on;The parameter for needing to transmit includes queue
The message entity information of mark and transmitting.
The configuration center, that is, micro services system configuration center is to concentrate deployment, and each service unit can visit
Configuration center is asked, configuration center is for the subscription between storage queue essential information, consumer information and queue and consumer
Relationship.
In the step (D), the Connection object that poll monitors each subscription of service is receiving correspondence
Message after, according to consumer information call information consumption processing logic;It is automatic to call if processing failure or exception
The abnormality processing strategy of consumer information configuration is handled.
The beneficial effects of the present invention are: simple, scalability should be called based on the message delivery method for supporting more message queues
By force, user does not need the service type for being concerned about specific message queue, and when replacing Message Queuing Services, does not need change upper layer
Code has good application value.
Detailed description of the invention
Attached drawing 1 is that the present invention is based on the message delivery method schematic diagrames for supporting more message queues.
Attached drawing 2 is that the present invention is based on the message delivery method configuration diagrams for supporting more message queues.
Attached drawing 3 is that the present invention monitors method of servicing schematic diagram.
Attached drawing 4 is message method schematic diagram of the present invention.
Attached drawing 5 is message receival method schematic diagram of the present invention.
Specific embodiment
In order to make those skilled in the art better understand the technical solution in the present invention, below in conjunction with of the invention real
The attached drawing in example is applied, technical solution in the embodiment of the present invention carries out clear, complete description.Obviously, described implementation
Example is only a part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, this field is common
Technical staff's every other embodiment obtained without making creative work, all should belong to protection of the present invention
Range.
This is based on the message delivery method for supporting more message queues, by adapter Adapter to each message queue
Client is adapted to, including adapter Adapter and different types of message queue connector Binder two parts;The company
Encapsulation of the device Binder expression to a certain message queue client is connect, the adapter Adapter is to connector Binder's
Further encapsulation, so that message is sent and message sink execution does not perceive the type of message queue;The adapter Adapter
The adapter Adapter for sending, receiving and consuming including message, the adapter Adapter that consumer subscribes to, monitors, it is total to connect
Pond management and consumer organize management, and reserve expansible interface, facilitate when increasing different connector Binder, to difference
The adaptation of message queue.
This is based on the message delivery method for supporting more message queues, comprising the following steps:
(A) user creates queue essential information, consumer's essential information, the subscribing relationship between queue and consumer;
(B) user enables poll and monitors service, subscribes to consumer, and monitor queue;
(C) user calls message to send api interface and sends message;
(D) poll monitoring service, which receives after user is sent to message, calls message to execute program progress information consumption.
In the step (A), the transmitting terminal of message and the receiving end of message can separate and dispose, and the message sending end is
The initiator that message is sent;Message sink end is the side that message sink executes;Message sender and message receiver can portions
Administration is in the different service units of micro services system;The essential information of queue, consumer information, between queue and consumer
Relationship is to concentrate deployment;The essential information of queue includes queued name, the mark letter of Binder belonging to queue description and queue
Breath;Message person's information includes the programmed logic that information consumption executes, and Binder belonging to consumer and information consumption execute failure
Or abnormal processing strategie;Subscribing relationship mainly includes the mark of queue, consumer identification and routing iinformation.
In the step (B), poll services are disposed in each service unit, are touched automatically when service unit enables
Send out the enabling of poll services;When poll services enable, the time interval of poll is obtained in configuration center first, then when each
Between interval reach after obtain this service unit from caching or configuration center database and need the consumer information subscribed to.
Data in the caching can periodically update, per acquisition message person's information from configuration center at regular intervals,
And update caching;After monitoring service acquisition to the consumer information for needing to subscribe to, it is active to check whether consumer has
Connection object be connected to for connector Binder server-side, Connection pairs is re-created if not
As, and guarantee that one and only one Connection object of the consumer of each subscription is connected to Binder to server-side.
Per supporting a kind of message queue type, need to increase a kind of connector Binder to the client of the message queue more
It is packaged;It is logical between Message Queuing Services corresponding with Binder end that the Connection object indicates that consumer subscribes to
Road.
In the step (C), according to the subscribing relationship of queue and consumer in configuration center, message entity is sent to
Corresponding consumer subscribes to;User calls message to send api interface and sends message, then obtains the transmission Connection of creation
Object, by adapter Adapter transmit the message to for connector Binder on;The parameter for needing to transmit includes queue
The message entity information of mark and transmitting.
The configuration center, that is, micro services system configuration center is to concentrate deployment, and each service unit can visit
Configuration center is asked, configuration center is for the subscription between storage queue essential information, consumer information and queue and consumer
Relationship.
In the step (D), the Connection object that poll monitors each subscription of service is receiving correspondence
Message after, according to consumer information call information consumption processing logic;It is automatic to call if processing failure or exception
The abnormality processing strategy of consumer information configuration is handled.
This is based on the message delivery method for supporting more message queues, and calling is simple, scalability is strong, can be according to scene not
The different consumer with creation, and be mounted on different Binder, and user does not need the clothes for being concerned about specific message queue
Service type;The Binder that can also be created and switch according to demand, it is only necessary to modify configuration in configuration center, not need
Or the original code of modification few to the greatest extent, there is good application value.
It is detailed based on supporting the message delivery method of more message queues to carry out to one of present example above
It introduces.This part is expounded the principle and embodiment of invention using specific example, and above example is only used for helping to manage
Core of the invention thought is solved, without departing from the principles of the present invention, those of ordinary skill in the art are not making wound
Every other embodiment obtained under the premise of the property made labour, should fall within the scope of the present invention.
Claims (9)
1. a kind of based on the message delivery method for supporting more message queues, it is characterised in that: by adapter Adapter to each
The client of message queue is adapted to, including adapter Adapter and different types of message queue connector Binder two
Part;The connector Binder indicates the encapsulation to a certain message queue client, and the adapter Adapter is to connection
The further encapsulation of device Binder, so that message is sent and message sink execution does not perceive the type of message queue;It is described suitable
Orchestration Adapter includes the adapter Adapter that message sends, receives and consumes, the adapter that consumer subscribes to, monitors
Adapter, total connection pool management and consumer organize management, and reserve expansible interface, facilitate and increase different connectors
Adaptation when Binder, to different types of messages queue.
2. according to claim 1 based on the message delivery method for supporting more message queues, which is characterized in that including following
Step:
(A) user creates queue essential information, consumer's essential information, the subscribing relationship between queue and consumer;
(B) user enables poll and monitors service, subscribes to consumer, and monitor queue;
(C) user calls message to send api interface and sends message;
(D) poll monitoring service, which receives after user is sent to message, calls message to execute program progress information consumption.
3. according to claim 2 based on the message delivery method for supporting more message queues, it is characterised in that: the step
(A) in, the transmitting terminal of message and the receiving end of message can separate and dispose, and the message sending end is the initiation that message is sent
Side;Message sink end is the side that message sink executes;Message sender and message receiver can be deployed in micro services system
Different service units in;The essential information of queue, consumer information, the relationship between queue and consumer are to concentrate deployment
's;The essential information of queue includes queued name, Binder identification information belonging to queue description and queue;Message person's packet
The programmed logic of information consumption execution is included, Binder belonging to consumer and information consumption execute the processing plan of failure or exception
Slightly;Subscribing relationship mainly includes the mark of queue, consumer identification and routing iinformation.
4. according to claim 2 based on the message delivery method for supporting more message queues, it is characterised in that: the step
(B) in, poll services are disposed in each service unit, automatic trigger poll services opens when service unit enables
With;Poll services enable when, first configuration center obtain poll time interval, then each time interval arrival after from
The consumer information that this service unit needs to subscribe to is obtained in caching or configuration center database.
5. according to claim 4 based on the message delivery method for supporting more message queues, it is characterised in that: the caching
In data can timing update, per message person's information is obtained from configuration center at regular intervals, and update caching;Monitor clothes
Business is got need the consumer information subscribed to after, check whether consumer has active Connection object to be connected to pair
In connector Binder server-side, Connection object is re-created if not, and guarantee disappearing for each subscription
One and only one Connection object of expense person is connected to Binder to server-side.
6. according to claim 4 based on the message delivery method for supporting more message queues, it is characterised in that: supported per more
A kind of message queue type needs to increase a kind of connector Binder and is packaged to the client of the message queue;It is described
Connection object indicates that consumer subscribes to the channel between Message Queuing Services corresponding with Binder end.
7. according to claim 2 based on the message delivery method for supporting more message queues, it is characterised in that: the step
(C) it in, according to the subscribing relationship of queue and consumer in configuration center, sends message entity to corresponding consumer and orders
It reads;User calls message to send api interface and sends message, then obtains the transmission Connection object of creation, passes through adaptation
Device Adapter transmit the message to for connector Binder on;The parameter for needing to transmit includes queue identity and transmitting
Message entity information.
8. according to claim 7 based on the message delivery method for supporting more message queues, it is characterised in that: the configuration
Center, that is, micro services system configuration center is to concentrate deployment, and configuration center can be accessed in each service unit, configure
Center is for the subscribing relationship between storage queue essential information, consumer information and queue and consumer.
9. according to claim 2 based on the message delivery method for supporting more message queues, it is characterised in that: the step
(D) in, poll monitors the Connection object of each subscription of service after receiving corresponding message, according to disappearing
The processing logic of the person's of expense information calling information consumption;It is automatic that consumer information is called to configure if processing failure or exception
Abnormality processing strategy is handled.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910004710.4A CN109710435A (en) | 2019-01-03 | 2019-01-03 | A kind of message delivery method based on the more message queues of support |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910004710.4A CN109710435A (en) | 2019-01-03 | 2019-01-03 | A kind of message delivery method based on the more message queues of support |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109710435A true CN109710435A (en) | 2019-05-03 |
Family
ID=66260695
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910004710.4A Pending CN109710435A (en) | 2019-01-03 | 2019-01-03 | A kind of message delivery method based on the more message queues of support |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109710435A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110399236A (en) * | 2019-07-25 | 2019-11-01 | 泰康保险集团股份有限公司 | Adaptation method, device, medium and the electronic equipment of message queue |
CN113419882A (en) * | 2021-08-24 | 2021-09-21 | 成都特维思科技有限公司 | Method for dynamically switching message queue |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106933589A (en) * | 2017-03-13 | 2017-07-07 | 车智互联(北京)科技有限公司 | A kind of message queue component based on configuration and its integrated method |
CN107070782A (en) * | 2017-05-02 | 2017-08-18 | 山东浪潮通软信息科技有限公司 | A kind of Interface integration method, server and the system expansible based on message queue |
CN107766205A (en) * | 2017-10-10 | 2018-03-06 | 武汉大学 | A kind of monitoring system and method towards the tracking of micro services invoked procedure |
CN108156223A (en) * | 2017-12-06 | 2018-06-12 | 深圳市猫投鹰信息科技有限公司 | A kind of accurate supplying system of message based on websocket and method |
CN108509524A (en) * | 2018-03-12 | 2018-09-07 | 上海哔哩哔哩科技有限公司 | Method, server and the system of data processing of data processing |
-
2019
- 2019-01-03 CN CN201910004710.4A patent/CN109710435A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106933589A (en) * | 2017-03-13 | 2017-07-07 | 车智互联(北京)科技有限公司 | A kind of message queue component based on configuration and its integrated method |
CN107070782A (en) * | 2017-05-02 | 2017-08-18 | 山东浪潮通软信息科技有限公司 | A kind of Interface integration method, server and the system expansible based on message queue |
CN107766205A (en) * | 2017-10-10 | 2018-03-06 | 武汉大学 | A kind of monitoring system and method towards the tracking of micro services invoked procedure |
CN108156223A (en) * | 2017-12-06 | 2018-06-12 | 深圳市猫投鹰信息科技有限公司 | A kind of accurate supplying system of message based on websocket and method |
CN108509524A (en) * | 2018-03-12 | 2018-09-07 | 上海哔哩哔哩科技有限公司 | Method, server and the system of data processing of data processing |
Non-Patent Citations (2)
Title |
---|
RAISE HEAD: ""介绍Spring Cloud Stream与RabbitMQ集成"", 《HTTPS://WWW.JIANSHU.COM/P/67C79C1149DF》 * |
无名: ""Spring Cloud Dalston 中文文档 参考手册 中文版"", 《HTTPS://WWW.SPRINGCLOUD.CC/SPRING-CLOUD-DALSTON.HTML#_CLIENT_SIDE_USAGE》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110399236A (en) * | 2019-07-25 | 2019-11-01 | 泰康保险集团股份有限公司 | Adaptation method, device, medium and the electronic equipment of message queue |
CN113419882A (en) * | 2021-08-24 | 2021-09-21 | 成都特维思科技有限公司 | Method for dynamically switching message queue |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8769025B2 (en) | Cluster server of an instant messaging system and messaging method between clusters | |
WO1999057621B1 (en) | Embedded network management system | |
CN101227632A (en) | Distributed call centre system and traffic distributed transferring method | |
US10834033B2 (en) | Method and system for transferring messages between messaging systems | |
EP1744519A8 (en) | Information exchange system, management server, and method for reducing the network load | |
US20110086649A1 (en) | Methodology for Traffic Control Based on Cross-Carriers Short Message (SMS) Application | |
CN108631955A (en) | It is a kind of to ensure that message sends reachable mthods, systems and devices | |
CN109710435A (en) | A kind of message delivery method based on the more message queues of support | |
CN114866528A (en) | Data communication method based on MQTT and Websocket | |
CN109167831A (en) | Multi-site user behavior information synchronization method and system | |
CN108762945A (en) | A kind of implementation method for supporting a variety of message queues | |
CN110365729A (en) | The push of response type message, method of reseptance and response type message push system | |
CN201985898U (en) | Communication service load balancing system | |
CN111818131A (en) | Message pushing and scheduling system and method | |
CN105721553B (en) | A kind of adaptive cluster message distributor | |
CN105207860A (en) | Business acceleration system and method | |
CN101977396B (en) | System and method for realizing network element service switching in multimedia messaging service | |
EP2944073A2 (en) | Method and system for the handling of redundant long poll | |
CN115866535A (en) | Method and system for realizing 5G message access by multiple protocols | |
CN101150443B (en) | Processing method for telecommunication network management message | |
CN105376155A (en) | Intelligent route system and method based on distributed cluster framework | |
KR20120128013A (en) | System and method for providing push service | |
CN110443710B (en) | Block chain system and method for batch signature | |
CN100571418C (en) | Short message service center's cluster system and control method thereof | |
CN104796482A (en) | Intelligent converged communication system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |