<?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"
	xsi:schemaLocation="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">

	<bean id="executor" class="java.util.concurrent.Executors" factory-method="newCachedThreadPool"
		  destroy-method="shutdown"/>

	<int:splitter input-channel="in" output-channel="aggregationChannelFromSplitter"/>

	<int:aggregator input-channel="aggregationChannelFromSplitter" output-channel="resultChannel"
			release-strategy-expression="size() == 2"
			expire-groups-upon-completion="true"/>

	<int:aggregator input-channel="aggregationChannelCustomCorrelation" output-channel="resultChannel"
			release-strategy-expression="size() == 2"
			correlation-strategy-expression="headers.correlation"
			expire-groups-upon-completion="true"/>

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

</beans>
