<?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"
	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">

	<channel id="queueChannel">
		<queue capacity="1"/>
	</channel>

	<channel id="queueChannelForHeadersTest">
		<queue capacity="1"/>
	</channel>

	<outbound-channel-adapter id="outboundWithImplicitChannel" ref="consumer" auto-startup="false" phase="-1"/>

	<outbound-channel-adapter id="methodInvokingConsumer" ref="testBean" method="store"/>

	<outbound-channel-adapter id="expressionConsumer" expression="@testBean.store(payload)"/>

	<inbound-channel-adapter id="methodInvokingSource" ref="testBean" method="getMessage"
							 channel="queueChannel" auto-startup="false" phase="-1">
		<poller max-messages-per-poll="1" fixed-delay="10000"/>
	</inbound-channel-adapter>

	<channel id="withTimeoutChannel">
		<queue/>
	</channel>

	<inbound-channel-adapter id="methodInvokingSourceWithTimeout" ref="testBean" method="getMessage"
							 channel="withTimeoutChannel" auto-startup="false"
							 send-timeout="999">
		<poller max-messages-per-poll="1" fixed-rate="800"/>
	</inbound-channel-adapter>

	<inbound-channel-adapter id="methodInvokingSourceWithHeaders" ref="testBean" method="getMessage" channel="queueChannelForHeadersTest" auto-startup="false">
		<poller max-messages-per-poll="1" fixed-delay="10000"/>
		<header name="foo" value="ABC"/>
		<header name="bar" expression="new Integer(123)"/>
	</inbound-channel-adapter>

	<beans:bean id="consumer" class="org.springframework.integration.config.TestConsumer"/>

	<beans:bean id="testBean" class="org.springframework.integration.config.TestBean"/>


	<poller default="true" max-messages-per-poll="1" fixed-delay="100"/>

	<channel id="channelAdapter1Channel">
		<queue/>
	</channel>

	<channel id="channelAdapter2Channel">
		<queue/>
	</channel>

	<beans:bean id="counter1" class="java.util.concurrent.atomic.AtomicInteger"/>

	<beans:bean id="counter2" parent="counter1"/>

	<inbound-channel-adapter channel="channelAdapter1Channel" ref="counter1" method="incrementAndGet"/>

	<inbound-channel-adapter channel="channelAdapter2Channel"  ref="counter2" method="incrementAndGet"/>

	<beans:bean id="testMessageSource" class="org.springframework.integration.config.TestSource"/>

	<channel id="messageSourceRefChannel">
		<queue/>
	</channel>

	<inbound-channel-adapter id="adapterWithMessageSourceRef" channel="messageSourceRefChannel"  ref="testMessageSource"/>

</beans:beans>
