生产者,当有变化的数据时,需要通知前台系统,搜索系统(消费者)
一对多
1后台系统整合spring(生产者:生产者到交换机)
1-1》导入依赖需要配置在taotao-manage-service中
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-rabbit</artifactId>
<version>1.4.0.RELEASE</version>
</dependency>
1-2》添加配置文件
applicationContext-rabbitmq.xml:(因为作为生产者,只需要和交换机建立联系,所以没有消费者,队列)
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:rabbit="http://www.springframework.org/schema/rabbit"
xsi:schemaLocation="http://www.springframework.org/schema/rabbit
http://www.springframework.org/schema/rabbit/spring-rabbit-1.4.xsd
http://www.springfr