Invention content
The technical assignment of the present invention is to be directed to the above shortcoming, provides a kind of realization side supporting a variety of message queuesMethod.
The technical solution adopted by the present invention to solve the technical problems is:
A kind of implementation method for supporting a variety of message queues, realization process are:
Step 1: first configure message queue connector, the message queue connector offer includes send message, reception message,Message monitors, the messenger service of message monitoring;
Step 2: the service that message queue connector provides is called to realize the asynchronous communication between user.
In the step 1, the configuration process of message queue connector is:
1)Configure Message Queuing Services connection;
2)It configures message queue and sends message interface;
3)It configures message queue and receives message interface;
4)It configures message queue and monitors service;
5)Configure message queue management service.
The step 1)In, Message Queuing Services connection includes the server address of message queue connector, port numbers, companyConnect mode, connection description information, registrable multiple, a plurality of types of Message Queuing Services of the Message Queuing Services.
The step 2)In, it includes the transmission message interface program that message queue provides that message queue, which sends message interface,Collection, class name, method name and parameter declaration information.
The step 3)In, it includes the reception message interface program that message queue provides that message queue, which receives message interface,Collection, class name, method name and parameter declaration information.
The step 4)In, the message queue service of monitoring includes the monitoring service routine collection, class name, side of message queue offerReligious name and parameter declaration information.
The step 5)In, message queue management service includes the supervisor services collection, class name, side of message queue offerReligious name and parameter declaration information.
The asynchronous communication realized in the step 2 refers to:By message queue connector configuration in business application system orBetween asynchronous communication scene between system, a variety of message queues are connected by message queue connector, provides and disappears for all usersBreath service, realizes message communicating.
The specific implementation process of the step 2 is:
The message transmission interface that message sender calls message queue connector to provide carries out message transmission;
Message receiver calls the message sink interface that message queue connector provides, and receives message and generates corresponding respond;
In message transmitting process, the management service of message queue offer, the transmission of monitoring message or reception condition are called.
Compared to the prior art a kind of implementation method for supporting a variety of message queues of the present invention, has below beneficial to effectFruit:
The present invention is provided general message queue connection type, can be fitted by a kind of connector for supporting a variety of message queuesWith various types of message queues, the cost of implementation that asynchronous communication is carried out using message queue is reduced, it is highly practical, it is applicable in modelIt encloses extensively, solves the problems, such as that different clients carry out business application system asynchronous communication using different types of message queue.
Specific implementation mode
The invention will be further described in the following with reference to the drawings and specific embodiments.
As shown in Fig. 1, a kind of implementation method for supporting a variety of message queues of the invention, mainly by registering a variety of disappearThe mode of queue service is ceased to realize that a variety of message queues of connection carry out message communicating, it is intended to be solved different clients and be used inhomogeneityThe message queue of type carries out the problem of business application system asynchronous communication.
Its realization process is:
Step 1: first configure message queue connector, the message queue connector offer includes send message, reception message,Message monitors, the messenger service of message monitoring;
Step 2: the service that message queue connector provides is called to realize the asynchronous communication between user.
Above-mentioned message queue connector is based on Active MQ, Kafka MQ, Rabbit MQ and realizes.
In the step 1, the configuration process of message queue connector is:
S100:Configure Message Queuing Services connection;
S101:It configures message queue and sends message interface;
S102:It configures message queue and receives message interface;
S103:It configures message queue and monitors service;
S104:Configure message queue management service.
In the step s 100, configuration Message Queuing Services connection.It further illustrates, Message Queuing Services connection includes messageThe information such as queue Broker server address, port numbers, connection type, connection description, support registration is multiple, a plurality of types of to disappearCease queue service.
In step S101, configuration message queue sends message interface.It further illustrates, message queue sends message and connectsMouthful, including the information such as transmission message interface procedure set, class name, method name and parameter declaration of message queue offer.
In step s 102, configuration message queue receives message interface.It further illustrates, message queue receives message and connectsMouthful, including the information such as reception message interface procedure set, class name, method name and parameter declaration of message queue offer.
In step s 103, configuration message queue monitors service.It further illustrates, message queue monitors service, including disappearsCease the information such as monitoring service routine collection, class name, method name and the parameter declaration that queue provides.
In step S104, message queue management service is configured.It further illustrates, message queue management service, including disappearsCease the information such as supervisor services collection, class name, method name and the parameter declaration that queue provides.
In step 2, message queue connector provides common message handling services.It further illustrates, message queue connectsDevice is connect to provide according to configuration and send message, receive the services such as message, message monitoring, message management monitoring.
Embodiment explanation:The present invention realizes the service by registration message queue Broker and its offer, ERP systemThe service that message queue connection provides is called to realize that sales order connects with the asynchronous communication of order, ERP system, message queue is producedThe logical relation connect between device, message queue is as shown in Figure 1.
The service of registration message queue Broker and its offer first, registration configuration structure are as shown in Figure 2.FurtherlyIt is bright, include the following steps:
Configure message queue connection;
It configures message queue and sends message interface;
It configures message queue and receives message interface;
It configures message queue and monitors service;
Configure message queue message management services.
Then, it calls the service that message queue connector provides to realize asynchronous communication, further illustrates, including following stepSuddenly:
The message transmission interface that sales order calls message queue connector to provide carries out transmission order information;
The message sink interface that order calls message queue connector to provide is produced, the generation production of sales order information is received and ordersIt is single;
Finally, the management service for calling message queue to provide, the transmission of monitoring message or reception condition.
The technical personnel in the technical field can readily realize the present invention with the above specific embodiments,.But it answersWork as understanding, the present invention is not limited to above-mentioned specific implementation modes.On the basis of the disclosed embodiments, the technical fieldTechnical staff can arbitrarily combine different technical features, to realize different technical solutions.
It is the known technology of those skilled in the art in addition to the technical characteristic described in specification.