Detailed Explanation of SpringBoot Integration RabbitMQ

Note: The following are not catalogs but knowledge points
————————————— Basic knowledge————————————
1. The importance of MQ
2. MQ overview
3. MQ Advantages
4, MQ disadvantages
5, common MQ products
6, RabbitMQ overview
7, RabbitMQ installation 8,
RabbitMQ console use
9, RabbitMQ quick start - producer
10, RabbitMQ quick start - consumer
11, RabbitMQ working mode - WorkQueues
12 , RabbitMQ working mode—PubSub producer
13, RabbitMQ working mode—PubSub consumer
14, RabbitMQ working mode—Routing
15, RabbitMQ working mode—Topics
16, RabbitMQ working mode—Summary
——————————— Spring Application Knowledge ——————————————
17. Spring Integration RabbitMQ—Producer
18, Spring Integration RabbitMQ—Consumer
19, Spring Integration RabbitMQ—Configuration Detailed Explanation
———————— SpringBoot Application Knowledge ——————————————
20. SpringBoot integrates RabbitMQ—producer
21. SpringBoot integrates RabbitMQ—consumer
————————————Advanced Knowledge——————————————
1. Opening
2. Advanced Features—Reliable Delivery of Messages-confirm
3. Advanced Features—Reliable Delivery of Messages—return
4 , Advanced Features—Consumer Ack
5, Advanced Features—Consumer Current Limiting
6, Advanced Features—TTL
7, Advanced Features—Dead Letter Queue—Overview
8, Advanced Features—Dead Letter Queue—Code
9, Advanced Features—Delay Queue—Overview
10. Advanced Features - Delay Queue - Code
11. Advanced Features - Log and Monitoring
12. Advanced Features - Message Tracking
13. Application Issues - Message Compensation
14. Application Issues - Idempotency Guarantee
15. Cluster Construction - Mirror Queue
16. Clusters build-haproxy

2 MQ Overview

MQ full nameMmessageQueue (message queue) is a container for storing messages during message transmission. It is mostly used for communication between distributed systems.
insert image description here
Reach the following effect
insert image description here

  • MQ, message queue, middleware for storing messages
  • There are two ways of distributed system communication: direct remote call and indirect communication with the help of a third party
  • The sender is called the producer and the receiver is called the consumer

3&4 MQ Advantages and Disadvantages

Advantages :

  • application decoupling
    insert image description here
    insert image description here
  • Asynchronous speed up
    insert image description here
    insert image description here

  • insert image description here
    insert image description here
    insert image description here
    insert image description here
    Disadvantages of peak shaving and valley filling :
    insert image description here
    insert image description here

5 Common MQ products

At present, there are many MQ products in the industry, such as RabbitMQ, RocketMQ, ActiveMQ, Kafka, ZeroMQ, MetaMq, etc., and there are also cases of directly using Redis as a message queue. Consider your own needs and MQ product features comprehensively.
insert image description here

6 Introduction to RabbitMQ

AMQP,Right nowAdvanced Message Queuing Protocol(Advanced Message Queuing Protocol), is a network protocol,
an open standard of application layer protocol, designed for message-oriented middleware. The client and message middleware based on this protocol can transfer messages, and are not
limited by different client/middleware products, different development languages ​​and other conditions. In 2006, the AMQP specification was released.Analogous to HTTP.
insert image description here
In 2007, RabbitMQ 1.0 developed by Rabbit Technology Company based on the AMQP standard was released. RabbitMQ is developed in Erlang language.
The Erlang language was designed by Ericson, a language specially developed for the development of highly concurrent and distributed systems, and is widely used in the telecommunications field.
The RabbitMQ infrastructure is as follows:
insert image description here
insert image description here
insert image description here
RabbitMQ provides 6 working modes: Simple mode, work queues, Publish/Subscribe publishing and subscription mode, Routing
routing mode, Topics topic mode, RPC remote call mode (remote call, not too MQ; no introduction for now).
Introduction to the corresponding mode on the official website: https://www.rabbitmq.com/getstarted.html
insert image description here

JMS

  • MS is the Java Message Service (JavaMessage Service) application programming interface, which is an API for message-oriented middleware in the Java platform
  • JMS is one of the JavaEE specifications, analogous to JDBC
  • Many message middleware implement the JMS specification, for example: ActiveMQ. RabbitMQ does not officially provide JMS implementation packages, but the open source community has

summary

1. RabbitMQ is a message queue product developed in Erlang language based on AMQP protocol.
2. RabbitMQ provides 6 working modes, and we learn 5 of them. This is the focus of today.
3. AMQP is a protocol, analogous to HTTP.
4. JMS is an API specification interface, analogous to JDBC.

RabbitMQ installation and configuration

  • RabbitMQ official address: http://www.rabbitmq.com/
  • Installation document: Documentation/Software/Installation RabbitMQ.md

Getting Started

Requirement: Use simple mode to complete message delivery
Steps:
①Create project (generator, consumer)
②Add dependencies respectively
③Write producer to send message
④Write consumer to receive message
insert image description here

Working mode of RabbitMQ

insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
The notes come from the integration of dark horse notes on the Internet. For more details, please watch the dark horse video at station b

Guess you like

Origin blog.csdn.net/m0_57249797/article/details/127162955
Recommended