What is distributed messaging middleware

Distributed system architecture, simply put, is the coordinated processing of a request by multiple systems. However, distributed system architectures can be highly coupled. The introduction of distributed messaging middleware can be well decoupled.

What is messaging middleware

  • Use efficient and reliable messaging mechanisms for platform-independent data exchange
  • Give data communication for integration of distributed systems
  • It extends interprocess communication in a distributed environment by providing a messaging and message queuing model.

Common messaging middleware

  • ActiveMQ
  • RabbitMQ
  • Kafka
  • RocketMQ

Core design of messaging middleware

Message queue MQ can bind a link between producer and consumer.

nature

One is mainly responsible for data reception and transmission, performance is generally higher than ordinary procedures.

Five core

  • agreement
  • Persistence mechanism
  • Message distribution mechanism
  • Highly available design
  • High reliability design

Let’s take a look at these five cores.

agreement

A protocol is a set of conventions that computers follow when communicating with each other. Three elements of the agreement:

  • grammar
  • The semantic
  • The sequential

Common protocols of message-oriented middleware:

  • OpenWire
  • AMQP
  • MQTT
  • Kafka
  • OpenMessage

Closer agreement

The Advanced Mesage Queuing Protocol (AMQP) is an Advanced message Queuing Protocol. Features: Transaction support, persistence support, born in the financial industry, has a natural advantage in reliable message processing.

MQTT

MQTT message queue telemetry transmission is an important part of the Internet of Things system architecture, an instant messaging protocol developed by IBM.

Features: lightweight, simple structure, fast transfer, no transaction support, no persistence related design.

Application scenario: The system has limited computing capability, low broadband, and unstable network.

Open the Message protocol

OpenMessaging is the first international standard launched in the field of distributed messaging in China.

Features: simple structure, fast resolution, transaction design, persistent design.

Kafka agreement

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.

persistence

Persistence refers to storing data on disks and preventing it from disappearing when a service restarts. Generally, there are two ways: write to the file system and save to the database. Currently, most distributed messaging middleware supports writing to file systems.

Message delivery

Generally divided into two ways. One is for producers to push messages to consumers, and the other is for consumers to pull messages to producers. These include publish subscribe, polling distribution, fair distribution, retransmission and message pull.

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. Practice:

  • Deployment mode of data sharing between the master and slave
  • Synchronous master-slave deployment (to solve load balancing problems)
  • Multiple active clusters are deployed synchronously
  • Multi-primary cluster forwarding deployment mode

Highly reliable

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.