Features
editFor example:
Such as landing system, after landing the user needs to call messaging system to send text messages said to have landed, but also to call logging system records the log landing, call sign of the integral system of landing points were increased, and so on and so on.
Strong coupling this case, the landing system and logging systems, messaging systems, system integration, etc., where there may be call fails, information loss and other risks, and it will increase the complexity of the system.
For example, call logging system fails, the log information will be lost once landed after landing, unable to get back.
And the order of execution will result in a low landing system operating efficiency.
So if you use messaging middleware, after landing only need to push the task message queue, will not have control of. Other systems from the queue to acquire the task.
Decoupling and asynchronous calls (asynchronous relative synchronization, the synchronization is to wait, when the system to perform a task, we must wait until the end of the task, the system will continue down, asynchronous not wait.)
As well as horizontal expansion can achieve safe and reliable advantages
2. Common types of MQ
activeMQ of java support good, the disadvantage is not friendly enough support to other languages, systems for SMEs
rabbitMQ good support for java, good support for other languages, cross-platform, language-independent
kaffka log message middleware supports big data scene
3.JMS specification
Referring to the specification jms MQ implementation, (specification is a convention)
The specification includes
Contributors: standard middleware server to achieve jms
Client: send or receive an application message
Producer / publisher: create and send messages client
Consumers / subscribers: receive and process messages client
Message: content delivery between applications
Message mode: means of message between the client, JMS topics and queues defined modes
Themes:
If the publisher released a 100 message, if there are n number of subscribers, each subscriber can get to 100 messages. That Subscribers can get to all messages (but if you subscribe to a news release after the theme, you can not get any information, can only get to the subject of the news release after the subscription period, say A subscribed to B, B released news, C and then subscribed to B, then only able to get a message, C can not, because it's subscription behavior occurs after B news release)
Queue Mode:
If the producers sent 100 messages, if there are n consumers, then add up each subscriber to get the total number of messages is 100.
There is no time limit. As long as there are messages in the queue, consumers can at any time pick up the message, a message can only be consumed by a consumer.
4.jms agreed Interface
ConnectionFactory factory class and obtain MQ service connections
Connection to the MQ connection services, created by ConnectionFactory
Session session MQ services will be created by the Connection
MessageProducer news producer, created by Session
MessageConsumer news consumers created by Session
Message message, created by Session
Destination Desination message
---------------------
(部分内容来源于百度百科)
来源:CSDN
原文:https://blog.csdn.net/qq_20009015/article/details/81409346