Detailed introduction of different versions of MQ

One: What is MQ?
        MQ is Message Queue, which is a communication method between applications and applications.
Two: So what are MQ? The following are the MQs commonly used by enterprises at present, and an introduction is made respectively.

RabbitMQ is an AMQP implementation, a traditional messaging queue system implementation, based on Erlang. The old MQ product is gone. The AMQP protocol is more used in enterprise systems, and in scenarios that require high data consistency, stability, and reliability, performance and throughput are second.


Kafka is an open source MQ system of linkedin. The main feature is that it processes message consumption based on the Pull mode and pursues high throughput. The initial purpose was to use for log collection and transmission. Since 0.8, it supports replication and does not support transactions, which is suitable for generating large amounts of data. data collection business for Internet services.


ZeroMQ is just a pattern library for network programming, which models and componentizes common network request forms (group management, link management, publish and subscribe, etc.), in short, above socket and below MQ. For MQ, network transmission is only a part of it, and more needs to be handled are message storage, routing, Broker service discovery and lookup, transaction, consumption mode (ack, recast, etc.), cluster service, etc.


ActiveMQ: An open source project with a long history, which has been applied in many products, implements the JMS1.1 specification, can be easily integrated with spring-jms, implements a variety of protocols, is not lightweight enough (more source code than RocketMQ), supports persistence To the database, the support for a large number of queues is not good.


RabbitMq:
It is more mature than kafka and supports AMQP transaction processing. In terms of reliability, RabbitMq exceeds kafka and exceeds ActiveMQ in performance.


Kafka:
The original intention of Kafka is to process logs. It does not support AMQP transaction processing. It can be regarded as a log system with strong pertinence, so it does not have the characteristics that a mature MQ should have.


Kafka's performance (throughput, tps) is stronger than RabbitMq, and it has advantages over RabbitMq if it is used for fast processing of large amounts of data.
Three: Why do you need a message queue (MQ)?


The main reason is that in a high-concurrency environment, requests are often blocked because there is no time for synchronous processing. For example, a large number of insert, update and other requests arrive at MySQL at the same time , which directly leads to countless row locks and table locks, and even the last request will be blocked. The accumulation is too much, which triggers the too many connections error. By using message queues, we can process requests asynchronously, which relieves the pressure on the system.



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325445205&siteId=291194637