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

	<context:property-placeholder properties-ref="props"/>

	<util:properties  id="props"/>

	<channel id="outputChannel">
		<queue capacity="5"/>
	</channel>
	<channel id="discardChannel">
		<queue capacity="5"/>
	</channel>

	<channel id="aggregatorWithReferenceInput"/>
	<aggregator id="aggregatorWithReference" ref="aggregatorBean"
				release-lock-before-send="${foo:true}"
				input-channel="aggregatorWithReferenceInput" output-channel="outputChannel"/>

	<channel id="aggregatorWithMGPReferenceInput"/>
	<aggregator id="aggregatorWithMGPReference" ref="aggregatorMGPBean"
				input-channel="aggregatorWithMGPReferenceInput" output-channel="outputChannel"/>

	<channel id="aggregatorWithCustomMGPReferenceInput"/>
	<aggregator id="aggregatorWithCustomMGPReference" ref="aggregatorCustomMGPBean"
				input-channel="aggregatorWithCustomMGPReferenceInput" output-channel="outputChannel"/>

	<channel id="completelyDefinedAggregatorInput"/>

	<beans:bean id="transactionManager" class="org.springframework.integration.transaction.PseudoTransactionManager"/>

	<aggregator id="completelyDefinedAggregator"
		input-channel="completelyDefinedAggregatorInput"
		output-channel="outputChannel"
		discard-channel="discardChannel"
		ref="aggregatorBean"
		release-strategy="releaseStrategy"
		correlation-strategy="correlationStrategy"
		send-timeout="86420000"
		send-partial-result-on-expiry="true"
		expire-groups-upon-completion="true"
		expire-groups-upon-timeout="false"
		empty-group-min-timeout="123"
		group-timeout="456"
		lock-registry="lockRegistry"
		scheduler="scheduler"
		message-store="store"
		pop-sequence="false"
		order="5"
		expire-duration="10000"
		expire-timeout="250">
			<expire-transactional/>
	</aggregator>

	<beans:bean id="lockRegistry" class="org.springframework.integration.support.locks.DefaultLockRegistry"/>

	<task:scheduler id="scheduler"/>

	<beans:bean id="store" class="org.springframework.integration.store.SimpleMessageStore"/>

	<channel id="aggregatorWithExpressionsInput"/>
	<channel id="aggregatorWithExpressionsOutput"/>
	<aggregator id="aggregatorWithExpressions"
		input-channel="aggregatorWithExpressionsInput"
		output-channel="aggregatorWithExpressionsOutput"
		expression="?[payload.startsWith('1')].![payload]"
		release-strategy-expression="#root.size()>2"
		correlation-strategy-expression="headers['foo']"/>

	<channel id="aggregatorWithReferenceAndMethodInput"/>
	<aggregator id="aggregatorWithReferenceAndMethod"
		ref="adderBean"
		method="add"
		input-channel="aggregatorWithReferenceAndMethodInput"
		output-channel="outputChannel"/>

	<channel id="aggregatorWithPojoReleaseStrategyInput"/>
	<aggregator id="aggregatorWithPojoReleaseStrategy"
		input-channel="aggregatorWithPojoReleaseStrategyInput"
		output-channel="outputChannel"
		ref="adderBean"
		method="add"
		release-strategy="pojoReleaseStrategy"
		release-strategy-method="checkCompletenessAsList"/>

	<channel id="aggregatorWithPojoReleaseStrategyInputAsCollection"/>
	<aggregator id="aggregatorWithPojoReleaseStrategyAsCollection"
		input-channel="aggregatorWithPojoReleaseStrategyInputAsCollection"
		output-channel="outputChannel"
		ref="adderBean"
		method="add"
		release-strategy="pojoReleaseStrategy"
		release-strategy-method="checkCompletenessAsCollection"/>

	<channel id="aggregatorWithExpressionsAndPojoAggregatorInput"/>
	<aggregator id="aggregatorWithExpressionsAndPojoAggregator"
		input-channel="aggregatorWithExpressionsAndPojoAggregatorInput"
		ref="aggregatorBean"
		release-strategy-expression="size() == 2"
		correlation-strategy-expression="headers['foo']"
		empty-group-min-timeout="60000"/>

	<beans:bean id="aggregatorBean"
		class="org.springframework.integration.config.TestAggregatorBean" />

	<beans:bean id="aggregatorMGPBean"
		class="org.springframework.integration.aggregator.SimpleMessageGroupProcessor" />

	<beans:bean id="aggregatorCustomMGPBean"
		class="org.springframework.integration.config.AggregatorParserTests$MyMGP" />

	 <beans:bean id="adderBean"
		class="org.springframework.integration.config.Adder" />

	<beans:bean id="releaseStrategy"
		class="org.springframework.integration.config.TestReleaseStrategy" />

	<beans:bean id="correlationStrategy" class="org.springframework.integration.config.TestCorrelationStrategy"/>

	<beans:bean id="pojoReleaseStrategy"
		class="org.springframework.integration.config.MaxValueReleaseStrategy">
		<beans:constructor-arg value="10" />
	</beans:bean>

</beans:beans>
