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

	<int:message-history/>

	<bean id="serializer" class="org.springframework.core.serializer.DefaultSerializer" />

	<bean id="deserializer" class="org.springframework.core.serializer.DefaultDeserializer" />

	<int-ip:tcp-connection-factory id="server"
		type="server"
		port="0"
		serializer="serializer"
		deserializer="deserializer"
		using-nio="true"
		single-use="true"
	/>

	<int-ip:tcp-connection-factory id="client"
		type="client"
		host="localhost"
		port="0"
		single-use="true"
		so-timeout="10000"
		serializer="serializer"
		deserializer="deserializer"
	/>

	<int:channel id="input" />

	<int:channel id="replies">
		<int:queue/>
	</int:channel>

	<int-ip:tcp-outbound-channel-adapter id="outboundClient"
		auto-startup="false"
		channel="input"
		connection-factory="client"/>

	<int-ip:tcp-inbound-channel-adapter id="inboundClient"
		auto-startup="false"
		channel="replies"
		connection-factory="client"/>

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

	<int-ip:tcp-outbound-channel-adapter id="outboundServer"
		channel="loop"
		connection-factory="server"/>

	<int:channel id="loop" />

</beans>
