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

	<int:gateway default-request-channel="pipeline01" default-request-timeout="10000" default-reply-timeout="10000"/>

	<int-jms:outbound-gateway request-channel="pipeline01"
		receive-timeout="10000"
		request-destination-name="pipeline01-queue-01">
		<int-jms:reply-listener />
	</int-jms:outbound-gateway>

	<int-jms:inbound-gateway request-channel="jmsIn"
		request-destination-name="pipeline01-queue-01"
		concurrent-consumers="10"
		reply-timeout="10000"/>

	<int:chain input-channel="jmsIn" output-channel="anotherGatewayChannel">
		<int:header-enricher>
			<int:header name="delay" expression="new java.util.Random().nextInt(3000)"/>
		</int:header-enricher>
		<int:delayer id="foo" default-delay="0" expression="headers.delay"/>
		<int:transformer expression="payload"/>
	</int:chain>

	<int-jms:outbound-gateway request-channel="anotherGatewayChannel"
		receive-timeout="10000"
		request-destination-name="pipeline01-queue-02">
		<int-jms:reply-listener />
	</int-jms:outbound-gateway>

	<int-jms:inbound-gateway request-channel="anotherIn"
		request-destination-name="pipeline01-queue-02"
		concurrent-consumers="10"
		reply-timeout="10000"/>

	<int:transformer input-channel="anotherIn" expression="payload"/>

	<util:constant id="jmsConnectionFactory"
				   static-field="org.springframework.integration.jms.ActiveMQMultiContextTests.connectionFactory"/>

</beans>
