<?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"
|
xmlns:context="http://www.springframework.org/schema/context"
|
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
http://www.springframework.org/schema/beans/spring-beans.xsd
|
http://www.springframework.org/schema/rabbit
|
http://www.springframework.org/schema/rabbit/spring-rabbit.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
|
|
<context:annotation-config />
|
<rabbit:connection-factory id="connectionFactory"
|
host="${rabbitmq.host}"
|
port="${rabbitmq.port}"
|
username="${rabbitmq.username}"
|
password="${rabbitmq.password}"
|
virtual-host="${rabbitmq.virtual-host}" />
|
|
<context:component-scan base-package="com.yeshi.fanli.util.mq.rabbit" />
|
|
<bean id="rabbitListenerContainerFactory"
|
class="org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory">
|
<property name="connectionFactory" ref="connectionFactory"/>
|
<!-- 可以根据需要配置其他属性 -->
|
</bean>
|
|
|
|
|
</beans>
|