咱們選擇基於Spring-Rabbit去操做RabbitMQ
https://github.com/spring-projects/spring-amqp
使用spring-boot-starter-amqp會自動添加spring-rabbit依賴,以下:git
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring‐boot‐starter‐amqp</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring‐boot‐starter‐test</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring‐boot‐starter‐logging</artifactId> </dependency>
加入引用的包
刷新一下包
消費者也加入包的引用
github
把springboot的日誌文件拷貝過來。從cms的工程複製過來的
定義包
建立配置文件類
spring
再把生產者的整個的包複製到消費者裏面
springboot