<?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:context="http://www.springframework.org/schema/context"
|
xmlns:rabbit="http://www.springframework.org/schema/rabbit"
|
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
http://www.springframework.org/schema/beans/spring-beans.xsd
|
http://www.springframework.org/schema/context
|
https://www.springframework.org/schema/context/spring-context.xsd
|
http://www.springframework.org/schema/rabbit
|
http://www.springframework.org/schema/rabbit/spring-rabbit.xsd">
|
|
<context:property-placeholder location="classpath:rabbitmq.properties"/>
|
|
<rabbit:connection-factory id="connectionFactory"
|
host="${rabbitmq.host}"
|
port="${rabbitmq.port}"
|
username="${rabbitmq.username}"
|
password="${rabbitmq.password}"
|
virtual-host="${rabbitmq.virtual-host}"/>
|
|
<!--基础部分-->
|
<bean id="queueHelloWorldListener" class="com.yeshi.buwan.util.mq.consumer.QueueHelloWorldListener"/>
|
<rabbit:listener-container connection-factory="connectionFactory" auto-declare="true">
|
<rabbit:listener ref="queueHelloWorldListener" queue-names="queue-hello-world"/>
|
</rabbit:listener-container>
|
</beans>
|