1. What is message middleware
Utilize efficient and reliable messaging mechanisms for platform-independent data exchange;
And based on data communication for the integration of distributed systems;
It scales inter-process communication in a distributed environment by providing a message passing and message queuing model;
2. Application scenarios of message middleware
Cross-system data transfer, high concurrent traffic peak shaving, data asynchronous processing, etc.
3. Commonly used message middleware
ActiveMQ、RabbitMQ、Kafka、RocketMQ
4. Design idea of message middleware
Protocol, persistence mechanism, message distribution strategy, high availability, high reliability
5. What is the agreement
A protocol is a set of conventions that are complied with when communicating between computers. Only by observing the same conventions can computers communicate with each other. A protocol is a set of conventions that are complied with when communicating between computers. Only by observing the same conventions can computers communicate with each other.
Three elements of the agreement :
Syntax : the structure or format of data and control information;
Semantics : what kind of control information needs to be sent, what action to complete and what kind of response to make;Timing (Synchronization) : A detailed description of the order in which events are implemented
Protocols commonly used in message middleware : OpenWire, AMQP, MQTT, Kafka, OpenMessage
MQTT protocol (RabbiMQ, ActiveMQ) :
MQTT (Message Queuing Telemetry Transport) is an instant messaging protocol developed by IBM and an important part of the IoT system architecture.
Features : Lightweight, simple structure, fast transmission, no transaction support, no persistence-related design
Application scenario : It is suitable for scenarios with limited computing power, low bandwidth, and unstable network.
Open Message Protocol (RocketMQ)
OpenMessaging is an application development standard in the field of distributed messaging middleware and stream processing, which was initiated by Ali in the past one or two years and co-founded with Yahoo, Didi Chuxing, Streamlio and other companies. It is the first international standard in the field of distributed messaging launched on a global scale in China.
Features : simple structure, fast parsing, transactional design, persistent design
Kafka ((kafka)
The Kafka protocol is a binary protocol based on TCP. The message is internally separated by length and consists of some basic data types.
Features : simple structure, fast parsing, no transaction design, persistent design
6. Common persistence methods
ActiveMQ | RabbitMQ | Kafka | RocketMQ | |
---|---|---|---|---|
File system | support | support | support | support |
database | support | / | / | / |
7. Commonly used message middleware distribution strategies
ActiveMQ | RabbitMQ | Kafka | RocketMQ | |
---|---|---|---|---|
publish subscribe | support | support | support | support |
poll distribution | support | support | support | / |
fair distribution | / | support | support | / |
Resend | support | support | / | support |
message pull | / | support | support | support |
8. High availability mechanism
High availability refers to the ability of a product to be in a state of performing a specified function under specified conditions and within a specified time or time interval.
When the business volume is large, a message middleware server may not be able to meet the demand, so the message middleware needs to be deployed in a cluster to achieve the purpose of high availability.
How to deploy master-slave master-slave shared data
Master-Slave master-slave synchronization deployment method
Broker-Cluster multi-master cluster synchronization deployment method
Broker-Cluster multi-master cluster forwarding deployment method
Master-Slave combined with Broker-Cluster
9. What is high reliability?
High reliability means that the system can continue to operate without failure . For example, a system that never crashes or reports errors, or has a low probability of crashing or reporting errors, is highly reliable.
In high-concurrency business scenarios, if the high reliability of the system cannot be guaranteed, the losses will be very serious.
To ensure the high reliability of the message middleware, the following aspects can be considered
Reliable message transmission : The correctness of data parsing between systems is guaranteed through protocols.
Reliable message storage : The storage reliability of messages is guaranteed through persistence.