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

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

	<util:properties id="props">
		<beans:prop key="failover">false</beans:prop>
	</util:properties>

	<channel id="noLoadBalancerNoFailover" >
		<dispatcher load-balancer="none" failover="${failover}"/>
	</channel>

	<channel id="noLoadBalancerNoFailoverExecutor" >
		<dispatcher load-balancer="none" failover="false" task-executor="taskExecutor"/>
	</channel>

	<channel id="loadBalancerNoFailover">
		<dispatcher load-balancer="round-robin" failover="false"/>
	</channel>

	<channel id="loadBalancerNoFailoverExecutor">
		<dispatcher load-balancer="round-robin" failover="false" task-executor="taskExecutor"/>
	</channel>

	<channel id="noLoadBalancerFailover">
		<dispatcher load-balancer="none" failover="true"/>
	</channel>

	<channel id="noLoadBalancerFailoverExecutor">
		<dispatcher load-balancer="none" failover="true" task-executor="taskExecutor"/>
	</channel>

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

	<!-- send async errors to null channel to avoid chatter -->
	<bridge input-channel="errorChannel" output-channel="nullChannel"/>

</beans:beans>
