- 在新建的模块中引入activemq
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-activemq</artifactId>
<version>2.2.1.RELEASE</version>
</dependency>
- 在application.yml 中引入activemq 配置
- 编写读取配置文件的配置类
- 在业务类中发送消息
- 接收队列消息
使用@JmsListener注解监听队列,当有消息时,则取出