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

	<beans profile="mapquest">

		<int:chain id="trafficGatewayChain" input-channel="trafficChannel" output-channel="prettifyXml">
			<int:header-enricher>
				<int:header name="mapquestapikey" value="#{environment['mapquest.apikey']}"/>
			</int:header-enricher>
			<int-http:outbound-gateway
				url="http://localhost:8084/traffic/v1/incidents?key={apikey}&amp;boundingBox={boundingBox}&amp;filters=construction,incidents&amp;inFormat=kvp&amp;outFormat=xml"
				http-method="GET"
				expected-response-type="java.lang.String">
				<int-http:uri-variable name="apikey" expression="headers.mapquestapikey"/>
				<int-http:uri-variable name="boundingBox" expression="payload.boundingBox"/>
			</int-http:outbound-gateway>
		</int:chain>

	</beans>
</beans>
