[Finishing] message queue -ActiveMQ

ActiveMQ Profile

ActiveMQ is based JMS (Java Message Servie) a messaging middleware specification open source implementation, ActiveMQ design goal is to provide a standard, message-oriented, it can span multiple languages ​​and systems application integration messaging middleware .

Data transfer process

Here Insert Picture Description
PS: negotiator message (Message Broker), in a connection, the client declares a channel, through a single connection to the concurrency control negotiator needed to build a reliable model, may be used herein and the serial access channel pools or thread e.g. thread concurrency model such local channels.
Popular terms refers to the service side of the MQ.

Two message delivery type

1) point to point transmission, i.e., corresponding to a consumer a producer, the producer push data broke, broke in a queue, the queue when the consumer acceptance of the article data storage.

2) transmission based publish / subscribe model, i.e. according to the subscription data corresponding to the received topic, a producer may push data to a plurality of consumers, and achieve MQTT protocol is similar.

Two kinds of different types of messaging, point to point transmission can be received before the consumer connection pushed data producers, consumers and transmission based publish / subscribe model can only receive data producer pushed after the connection.

MQTT agreement

MQTT stands for "Message Queuing Telemetry Transport", i.e., message queues telemetry transmission, based on a publish / subscribe model application layer protocol, the http based on a restful style of an application layer protocol.

MQTT protocol is a lightweight protocol as a low-cost, low bandwidth usage of instant messaging protocol, often used in the Internet of Things project. Also based publish / subscribe middleware model has ActiveMQ, Kafka and other messaging middleware, in the final analysis are implemented to transmit messages.

MQTT is based on TCP / IP is an application layer protocol, TCP / IP itself has been achieved in providing reliable network transmission of unreliable network environment functions , but also has its strategy MQTT agreement guarantees reliable transmission of messages.

MQTT pushed message, there are three quality of the message:

1. at most once, i.e., once the push message, as there is no push message successfully.
2. At least once, need confirmation message arrives, it could lead to receive duplicate data. (Note: MQTT retransmission mechanism defined in the TCP repetition mechanism is different, the mechanism of TCP is repeated if the number does not receive a corresponding response packet, it will again push the corresponding packet sequence number within the time limit, MQTT and retransmission mechanism is re-established when the client is connected, there is no previous response message corresponding to the replacement data packets, of course, the client can choose whether or not to receive the previously successfully transmitted data packet.)
3. only once, confirmation message arrives only once, commonly used for data demanding scenes, scenes such as billing, order scenario.

In essence, the client and server to establish a Socket, then send a response according to newspaper MQTT agreement. For example, after the establishment socket connet send packets to establish a connection, then the server will parse the connection message, and save the information about the connection.

SSL protocol

The SSL ( the Secure Sockets Layer ) Secure Sockets Layer. It was developed by Netscape in 1990, to protect the safety of Word Wide Web (WWW) communications. The main task is to provide privacy, message integrity and authentication. 1994 revision to SSLv2,1995年改版为SSLv3.

SSL is a platform-independent protocols and application program, the TCP / IP protocol between the various application layer protocols to improve data communications security support.

Architecture SSL protocol contains two sub-layers, where the bottom layer is the SSL Record Layer (SSL Record Protocol Layer); SSL handshake protocol is the high-level layer (SSL HandShake Protocol Layer).

SSL protocol is divided into two tiers:

SSL record layer protocol role is to provide basic security services to higher layer protocols. SSL record protocol is specifically designed for the HTTP protocol, making the hypertext transfer protocol (HTTP) to run SSL. History encapsulation of various high-level protocol, decompresses the compressed particular embodiments, encryption and decryption, security-related operations MAC checksum calculation and the like.
SSL handshake protocol including SSL handshake protocol layer (SSL HandShake Protocol), SSL encryption parameter modified protocol (SSL Change Cipher Spec Protocol) and SSL Alerting Protocol (SSL Alert Protocol). These layers handshake protocol for exchanging management information SSL, allowing mutual authentication between the application protocol data transmission, negotiate an encryption algorithm and a key generation and the like.

SSL handshake protocol role is to coordinate client and server status, so that they can reach a state of synchronization.

One of the most important is the record protocol and the handshake protocol:

SSL record protocol: it is based on a reliable transport (e.g., TCP), to provide high-level protocol data encapsulation, compression, encryption and other basic functions.
SSL handshake protocol: it is built on top of the SSL Record protocol for data transmission before the actual start of communication between the two sides authentication, negotiate an encryption algorithm, encryption key exchange and so on.
Published 42 original articles · won praise 0 · Views 1406

Guess you like

Origin blog.csdn.net/tcctcszhanghao/article/details/104049573