Spring boot integration rabbitmq sample code
Introduction to rabbitmq
Rabbitmq is a complete and reusable enterprise message system based on AMQP
The full name of MQ is message queue, Message queuing (MQ) is an application to application communication method. Applications read and write messages in and out of the queue (data for applications) without requiring a dedicated connection to link them. Messaging refers to communication between programs by sending data in messages rather than by direct calls to each other. Direct calls are usually used for technologies such as remote procedure calls. Queuing refers to applications communicating through queues. The use of queues removes connections Requirements for simultaneous execution of receiving and sending applications.
AMQP is a protocol, a high-level abstraction layer message communication protocol.
Although there are many open standards in the world of synchronous message communication (such as Cobar's IIOP, soap, etc.), this is not the case in asynchronous message processing. Only large enterprises have some commercial implementations (such as Microsoft's MSMQ, IBM's WebSphere MQ, etc.), therefore, in June 2006, Cisco, RedHat, imatix, etc. jointly formulated the open standard of AMQP. That is to say, AMQP is a protocol for asynchronous communication.
Rabbitmq usage scenario
In the project, some time-consuming operations without immediate return are extracted for asynchronous processing, which greatly saves the request response time of the server and improves the throughput of the system. However, most of them don't just need to return immediately, but even whether the execution is successful or not doesn't matter. If you need immediate return, you can use Dubbo. Spring boot is integrated with Dubbo. You can see the spring boot integration dubbox
Erlang official website
Erlang download address
Rabbitmq official website
Rabbitmq Download
Because this article mainly explains how to integrate rabbitmq from zero to springboot, many information and usage of rabbitmq are not explained. If you are not familiar with rabbitmq, you can see other articles about rabbitmq and attach this article demo