一、RabbitMQ简述与其docker安装
这里主要讲解实战整合rabbitMQ,了解RabbitMQ简述与其docker安装请点击:传送门
二、springboot整合rabbitMQ
1.新建springboot项目
2.pom:主要添加以下两个依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.2.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
<version>2.5.5</version>
</dependency>
3.yaml:
server:
port: 5672
spring:
rabbitmq:
host: 192.168.80.88 #mq服务器ip,默认为localhost
# port: 5672 #mq服务器port,默认为5672
# username: guest #mq服务器username,默认为gust
# password: guest #m