Getting started with ActiveMQ/RabbitMQ/RocketMQ/Kafka/Pulsar message middleware

 

MQ, message queue, message can be understood as a business site, while the queue is a container that holds the business site, and the processing of messages by service B is an asynchronous processing of the business site. Therefore, the essence of the message queue is to temporarily store a certain business site for asynchronous processing.

With the above essential understanding of MQ, then, the next few business scenarios applicable to MQ will be well understood.

1. Asynchronous . Just like the demo above, asynchrony is the first capability of MQ. Some non-core processes, such as logs, text messages, emails, etc., can be processed asynchronously through MQ. The advantage of this is to shorten the response time of the main process and improve the user experience.

2. Decoupling . Suppose now, not only the logs need to be inserted into the database, but also file-type logs are added to the hard disk. At the same time, some key logs are also sent to the designated person by email. Then, if following the original logic, A may need to expand on the original code, in addition to the B service, but also the storage of log files and the sending of log emails. However, if you use MQ, then the A service does not need to be changed, it can still put the message in the MQ, other services, whether it is the original B service or the new log file storage service or log The mail sending service can obtain and process the messages directly from MQ. This is decoupling, and its benefit is to improve system flexibility and scalability.

3. Peaking . This is actually very easy to understand, because the essence of MQ is business queuing. Therefore, in the face of sudden high concurrency, MQ does not need to rush, line up first, don't worry, come one by one. The advantage of peak reduction is to avoid high concurrency from overwhelming key components of the system, such as a core service or database.

Three main application scenarios of asynchronous, decoupling, peak elimination, and MQ

 

Message middleware (1) MQ detailed explanation and four MQ comparison 

https://www.aboutyun.com/thread-26974-1-1.html

 

ActiveMQ detailed entry tutorial

https://blog.csdn.net/qq_33404395/article/details/80590113

 

RabbitMQ quick start (detailed)

https://blog.csdn.net/kavito/article/details/91403659

 

Introduction to RocketMQ

https://blog.csdn.net/qq_34462387/article/details/86562856

 

Getting started with Kafka

https://baijiahao.baidu.com/s?id=1651919282506404758&wfr=spider&for=pc

https://blog.csdn.net/valada/article/details/79910104

 

pulsar

https://blog.csdn.net/tcy83/article/details/106731392

Guess you like

Origin blog.csdn.net/weixin_43075027/article/details/107787454