<?xml version="1.0" encoding="UTF-8"?>
<beans:beans
		xmlns="http://www.springframework.org/schema/integration/http"
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		xmlns:beans="http://www.springframework.org/schema/beans"
		xmlns:si="http://www.springframework.org/schema/integration"
		xmlns:util="http://www.springframework.org/schema/util"
		xsi:schemaLocation="http://www.springframework.org/schema/integration/http https://www.springframework.org/schema/integration/http/spring-integration-http.xsd
		http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd
		http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util.xsd">

	<si:channel id="requests"/>

	<outbound-channel-adapter id="minimalConfig" url="http://localhost/test1" channel="requests"/>

	<outbound-channel-adapter id="restTemplateConfig" url="http://localhost/test1" channel="requests"
							  rest-template="customRestTemplate"/>

	<beans:bean id="customRestTemplate" class="org.springframework.web.client.RestTemplate"/>

	<outbound-channel-adapter id="fullConfig"
							  url="http://localhost/test2/{foo}"
							  http-method="GET"
							  channel="requests"
							  charset="UTF-8"
							  message-converters="converterList"
							  extract-payload="false"
							  expected-response-type="java.lang.Boolean"
							  mapped-request-headers="requestHeader1, requestHeader2"
							  request-factory="testRequestFactory"
							  error-handler="testErrorHandler"
							  order="77"
							  encoding-mode="VALUES_ONLY"
							  auto-startup="false">
		<uri-variable name="foo" expression="headers.bar"/>

	</outbound-channel-adapter>

	<util:map id="uriVariables">
		<beans:entry key="foo1" value="bar1"/>
		<beans:entry key="foo2" value="bar2"/>
	</util:map>

	<outbound-channel-adapter id="withUrlAndTemplate"
							  url="http://localhost/test1" channel="requests"
							  uri-variables-expression="@uriVariables"
							  rest-template="customRestTemplate"/>

	<outbound-channel-adapter id="withUrlExpression" url-expression="'http://localhost/test1'" channel="requests"/>

	<outbound-channel-adapter id="withAdvice" url-expression="'http://localhost/test1'" channel="requests">
		<request-handler-advice-chain>
			<beans:bean
					class="org.springframework.integration.http.config.HttpOutboundChannelAdapterParserTests$FooAdvice"/>
		</request-handler-advice-chain>
	</outbound-channel-adapter>

	<outbound-channel-adapter id="withUrlExpressionAndTemplate"
							  url-expression="'http://localhost/test1'" channel="requests"
							  rest-template="customRestTemplate"/>

	<si:channel id="queueChannel">
		<si:queue capacity="10"/>
	</si:channel>
	<outbound-channel-adapter id="withPoller1" url="http://localhost/test1" channel="queueChannel">
		<si:poller fixed-delay="5000"/>
	</outbound-channel-adapter>

	<outbound-channel-adapter id="withPoller2" url="http://localhost/test1" channel="queueChannel">
		<request-handler-advice-chain/>
		<uri-variable name="foo" expression="headers.bar"/>
		<uri-variable name="bar" expression="headers.bar"/>
		<si:poller fixed-delay="5000"/>
	</outbound-channel-adapter>

	<outbound-channel-adapter id="withPoller3" url="http://localhost/test1" channel="queueChannel">
		<uri-variable name="foo" expression="headers.bar"/>
		<uri-variable name="bar" expression="headers.bar"/>
		<request-handler-advice-chain/>
		<si:poller fixed-delay="5000"/>
	</outbound-channel-adapter>

	<outbound-channel-adapter id="withPoller4" url="http://localhost/test1" channel="queueChannel">
		<si:poller fixed-delay="5000"/>
		<uri-variable name="foo" expression="headers.bar"/>
		<uri-variable name="bar" expression="headers.bar"/>
		<request-handler-advice-chain/>
	</outbound-channel-adapter>

	<outbound-channel-adapter id="withPoller5" url="http://localhost/test1" channel="queueChannel">
		<si:poller fixed-delay="5000"/>
		<request-handler-advice-chain/>
		<uri-variable name="foo" expression="headers.bar"/>
		<uri-variable name="bar" expression="headers.bar"/>
	</outbound-channel-adapter>

	<beans:bean id="testRequestFactory" class="org.springframework.http.client.SimpleClientHttpRequestFactory"/>

	<beans:bean id="testAsyncRequestFactory" class="org.springframework.http.client.SimpleClientHttpRequestFactory"/>

	<beans:bean id="testErrorHandler"
				class="org.springframework.integration.http.config.HttpOutboundChannelAdapterParserTests$StubErrorHandler"/>

	<util:list id="converterList">
		<beans:bean class="org.springframework.integration.http.config.StubHttpMessageConverter"/>
		<beans:bean class="org.springframework.integration.http.config.StubHttpMessageConverter"/>
	</util:list>

</beans:beans>
