2.AMQP(RabbitMQ)
一、添加依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>二、配置文件
# RABBIT (RabbitProperties)
#spring.rabbitmq.host=localhost
#spring.rabbitmq.port=5672
#spring.rabbitmq.password=
#spring.rabbitmq.username=三、代码实现
启用注解: @EnableRabbit
加到main函数之上
具体实现

util/configuration/AmqpConfiguration.java
component/DemoAmqpComponent.java
测试类
运行测试

资料
RabbitMQ下载地址:http://www.rabbitmq.com/download.html
erlang 下载地址:http://www.erlang.org/downloads
docker rabbitmq
-management结尾的镜像是带管理界面的
Last updated
Was this helpful?