Message queuing middleware is an important component in a distributed system. It mainly solves the problems of application decoupling, asynchronous messaging, traffic cutting, etc., to achieve high performance, high availability, scalability and eventual consistency architecture.
Currently, the most commonly used message queues are ActiveMQ, RabbitMQ, ZeroMQ, Kafka, RocketMQ.
The main application scenarios: decoupling, asynchronous, peak clipping
2. Application scenarios:
Spike activity: Spike activity, usually due to excessive traffic, causes a surge in traffic and application hangs.
User orders: In high concurrency scenarios, users need to notify the order system and inventory system after placing an order.
Distributed log system: In a distributed system, the log system needs to collect logs generated by each system.
3. Practical application of message queue
1. Decoupling:
2. Asynchronous:
3. Peak clipping:
4. Comparison table of mainstream message queues:
Five. Spring boot combined with RabbitMq actual combat (including source code)