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

	<si:channel id="requests"/>

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

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

	<outbound-gateway id="fullConfig"
					  url="http://localhost/test2"
					  http-method="PUT"
					  request-channel="requests"
					  request-factory="testRequestFactory"
					  reply-timeout="1234"
					  message-converters="converterList"
					  extract-request-payload="false"
					  expected-response-type="java.lang.String"
					  mapped-request-headers="requestHeader1, requestHeader2"
					  mapped-response-headers="responseHeader"
					  error-handler="testErrorHandler"
					  reply-channel="replies"
					  charset="UTF-8"
					  order="77"
					  auto-startup="false"
					  transfer-cookies="true"
					  extract-response-body="false">
		<uri-variable name="foo" expression="headers.bar"/>
	</outbound-gateway>

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

	<outbound-gateway id="withUrlExpression" url-expression="'http://localhost/test1'" request-channel="requests"
					  uri-variables-expression="@uriVariables"/>

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

	<si:channel id="queueChannel">
		<si:queue capacity="10"/>
	</si:channel>

	<outbound-gateway id="withPoller1" request-channel="queueChannel" url="http://localhost/test1">
		<si:poller fixed-delay="5000"/>
	</outbound-gateway>

	<outbound-gateway id="withPoller2" url="http://localhost/test1" request-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-gateway>

	<outbound-gateway id="withPoller3" url="http://localhost/test1" request-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-gateway>

	<outbound-gateway id="withPoller4" url="http://localhost/test1" request-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-gateway>

	<outbound-gateway id="withPoller5" url="http://localhost/test1" request-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-gateway>

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

	<beans:bean id="testErrorHandler"
				class="org.springframework.integration.http.config.HttpOutboundGatewayParserTests$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>
