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

	<gateway id="wat" 
		service-interface="org.springframework.integration.samples.testing.externalgateway.WeatherAndTraffic"
		default-request-channel="inputChannel"/>
	
	<publish-subscribe-channel id="inputChannel"
		apply-sequence="true" 
		task-executor="executor"/>

	<bridge input-channel="inputChannel"
		output-channel="trafficRequestChannel"/>
	
	<bridge input-channel="inputChannel"
		output-channel="weatherRequestChannel" />
		
	<!-- Results -->
	
	<bridge input-channel="trafficResponseChannel"
		output-channel="toStringChannel"/>
	
	<bridge input-channel="weatherResponseChannel"
		output-channel="toStringChannel"/>
		
	<channel id="toStringChannel"/>
	
	<transformer input-channel="toStringChannel"
		output-channel="aggregatorChannel"
		expression="payload.toString()"/>
		
	<channel id="aggregatorChannel" />
	
	<aggregator input-channel="aggregatorChannel" 
		expression="#this.![payload]"/>
	
	<task:executor id="executor" pool-size="10"/>
	
</beans:beans>
