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

	<jdbc:embedded-database id="dataSource" type="H2"/>

	<jdbc:initialize-database ignore-failures="DROPS">
		<jdbc:script location="org/springframework/integration/jdbc/schema-drop-h2.sql"/>
		<jdbc:script location="org/springframework/integration/jdbc/schema-h2.sql" />
	</jdbc:initialize-database>

	<int-jdbc:message-store id="messageStore" data-source="dataSource"/>

	<beans:bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
		<beans:property name="dataSource" ref="dataSource"/>
	</beans:bean>

	<aggregator input-channel="transactionalAggregatorInput" output-channel="transactionalAggregatorOutput"
				message-store="messageStore"
				send-partial-result-on-expiry="true"
				group-timeout="100">
		<expire-transactional/>
	</aggregator>

	<service-activator input-channel="transactionalAggregatorOutput" ref="exceptionHandler"/>

	<beans:bean id="exceptionHandler"
				class="org.springframework.integration.jdbc.AggregatorIntegrationTests$ExceptionMessageHandler"/>

</beans:beans>
