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

	<inbound-gateway path="/test" request-channel="testChannel"
					 payload-expression="T(org.springframework.web.context.request.RequestContextHolder).requestAttributes.request.queryString"/>

	<int:publish-subscribe-channel id="testChannel"/>

	<outbound-gateway id="proxyGateway" request-channel="testChannel"
					  url-expression="'http://testServer/test?' + payload"/>

	<int:bridge input-channel="testChannel" output-channel="checkHeadersChannel"/>

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

	<inbound-gateway path="/testmp" request-channel="testChannelmp"
					 message-converters="formHttpMessageConverter"/>

	<beans:bean id="formHttpMessageConverter"
				class="org.springframework.integration.http.converter.MultipartAwareFormHttpMessageConverter">
		<beans:property name="multipartFileReader">
			<beans:bean class="org.springframework.integration.http.multipart.SimpleMultipartFileReader"/>
		</beans:property>
	</beans:bean>

	<int:channel id="testChannelmp"/>

	<outbound-gateway id="proxyGatewaymp" request-channel="testChannelmp"
					  http-method="POST"
					  url="http://testServer/testmp"/>

</beans:beans>
