<?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
    http://www.springframework.org/schema/context/spring-context.xsd
    http://www.springframework.org/schema/rabbit
    http://www.springframework.org/schema/rabbit/spring-rabbit-1.4.xsd">
 
	
	<!-- spring template声明 -->
	<rabbit:template exchange="esb-consumer-mq-exchange"
		id="consumerTemplate" connection-factory="connectionFactory"
		message-converter="jsonMessageConverter" /> 

	<rabbit:queue id="queue_key_consumer" name="queue_key_consumer" durable="true"
		auto-delete="false" exclusive="false" />


	<rabbit:direct-exchange name="esb-consumer-mq-exchange"
		durable="true" auto-delete="false" id="esb-consumer-mq-exchange">
		<rabbit:bindings>
			<rabbit:binding queue="queue_key_consumer" key="consumer" />
		</rabbit:bindings>
	</rabbit:direct-exchange>

	<rabbit:listener-container
		connection-factory="connectionFactory" acknowledge="auto">
		<rabbit:listener queues="queue_key_consumer" ref="consumerService" />
	</rabbit:listener-container>  

</beans>