<?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:int="http://www.springframework.org/schema/integration"
	xmlns:int-amqp="http://www.springframework.org/schema/integration/amqp"
	xmlns:rabbit="http://www.springframework.org/schema/rabbit"
	xmlns:int-ip="http://www.springframework.org/schema/integration/ip"
	xsi:schemaLocation="http://www.springframework.org/schema/integration/amqp http://www.springframework.org/schema/integration/amqp/spring-integration-amqp.xsd
		http://www.springframework.org/schema/integration/ip http://www.springframework.org/schema/integration/ip/spring-integration-ip.xsd
		http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
		http://www.springframework.org/schema/rabbit http://www.springframework.org/schema/rabbit/spring-rabbit.xsd
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

	<!-- From TCP To RabbitMQ -->

	<int-ip:tcp-connection-factory id="server" type="server" port="11111" />

	<int-ip:tcp-inbound-channel-adapter channel="toRabbit" connection-factory="server" />

	<int:channel id="toRabbit" />

	<int-amqp:outbound-channel-adapter channel="toRabbit"
		amqp-template="amqpTemplate" exchange-name="si.test.exchange"
		routing-key="si.test.binding"/>

	<!-- From RabbitMQ To RabbitMQ -->

	<int-amqp:inbound-channel-adapter channel="fromRabbit"
			queue-names="si.test.queue"
			connection-factory="connectionFactory" />

	<int:channel id="fromRabbit" />

	<int-ip:tcp-connection-factory id="client" type="client" host="localhost" port="11112"/>

	<int-ip:tcp-outbound-channel-adapter channel="fromRabbit" connection-factory="client"/>

	<!-- Infrastructure -->

	<rabbit:connection-factory id="connectionFactory" host="localhost" />

	<rabbit:template id="amqpTemplate" connection-factory="connectionFactory" />

	<rabbit:admin connection-factory="connectionFactory" />

	<rabbit:queue name="si.test.queue" />

	<rabbit:direct-exchange name="si.test.exchange">
		<rabbit:bindings>
			<rabbit:binding queue="si.test.queue" key="si.test.binding" />
		</rabbit:bindings>
	</rabbit:direct-exchange>

</beans>
