This article has participated in the activity of “New person creation Ceremony”, and started the road of digging gold creation together.
What is message-oriented middleware
Use efficient and reliable messaging mechanisms for platform-independent data exchange;
Based on data communication, the distributed system is integrated.
By providing message passing and message queuing models, it can extend interprocess communication in distributed environment.
2. Application scenarios of message middleware
Cross-system data transfer, high concurrent traffic peak clipping, data asynchronous processing… , etc.
Common message-oriented 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 computers comply with when communicating with each other. Only when all computers comply with the same conventions can they communicate with each other. A protocol is a set of conventions that computers comply with when communicating with each other. Only when all computers comply with the same conventions can they communicate with each other.
Three elements of the agreement:
Syntax: the structure or format of data and control information; Semantics: that is, what kind of control information needs to be sent, what kind of action needs to be completed and what kind of response needs to be made;
Timing (synchronization): A detailed description of the order in which events are implemented
Commonly used protocols of messaging middleware :OpenWire, AMQP, MQTT, Kafka, OpenMessage
MQTT protocol (RabbiMQ, ActiveMQ):
MQTT (Message Queuing Telemetry Transport) is an im protocol developed by IBM and an important part of Internet of Things (iot) system architecture.
Features: lightweight, simple structure, fast transfer, no transaction support, no persistence related design
Application scenario: Applicable to scenarios with limited computing capability, low bandwidth, and unstable networks.
Open Message Protocol (RocketMQ)
OpenMessaging is an application development standard in the field of distributed message middleware and stream processing initiated by Alibaba in recent one or two years and co-founded by Yahoo, Didi Chuxing, Streamlio and other companies. It is China’s first international standard in the field of distributed messaging launched on a global scale. Features: simple structure, fast resolution, transaction design, persistent design
Kafka Protocol (Kafka)
The Kafka protocol is a binary protocol based on TCP. Messages are internally separated by length and consist of some basic data types. Features: simple structure, fast resolution, no transaction design, persistent design
6. Common persistence methods
ActiveMQ | RabbitMQ | Kafka | RocketMQ | |
---|---|---|---|---|
The file system | support | support | support | support |
The database | support | / | / | / |
Common messaging middleware distribution strategies
ActiveMQ | RabbitMQ | Kafka | RocketMQ | |
---|---|---|---|---|
Release subscription | support | support | support | support |
Polling distribution | support | support | support | / |
Fair distribution | / | support | support | / |
resend | support | support | / | support |
Message pull | / | support | support | support |
8. High availability
High availability refers to the ability of a product to perform a specified function under specified conditions and at specified times or time intervals.
When the traffic is large, one message-oriented middleware server may not be able to meet the demand. Therefore, it is necessary to deploy message-oriented middleware in clusters to achieve high availability.
Master-slave Specifies the deployment mode of the Master and Slave shared data
Master-slave Indicates the Master/Slave synchronization deployment mode
Broker-cluster Synchronous deployment mode of multiple primary clusters
Broker-cluster Multi-primary Cluster forwarding deployment mode
Master-slave is combined with broker-cluster
9. What is high reliability
High reliability means that the system can run continuously 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 concurrent business scenarios, if the system is not highly reliable, the loss will be very serious. To ensure the high reliability of message-oriented middleware, the following aspects can be considered
Reliable message transmission: Protocols are used to ensure the correctness of data parsing between systems.
Message storage reliability: The message storage reliability is guaranteed through persistence.