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

	<int:message-history/>

	<int:gateway id="gateway"
	             service-interface="org.springframework.integration.jms.config.JmsOutboundGatewayParserTests$SampleGateway"
		         default-request-channel="requests">
		<int:method name="echo">
			<int:header name="foo" value="bar"/>
		</int:method>
		<int:method name="echoAsMaessage">
			<int:header name="foo" value="bar"/>
		</int:method>
    </int:gateway>

	<int:chain input-channel="requests">
		<int-jms:outbound-gateway request-destination="requestQueueA"
	                              reply-destination="replyQueueB"
	                              connection-factory="jmsConnectionFactory"
	                              receive-timeout="100000"
	                              reply-timeout="200000"/>
	</int:chain>

	<int:chain id="chain1" input-channel="chainWithGatewayAtEnd">
		<int-jms:outbound-gateway id="gateway"
		                          request-destination="requestQueueA"
	                              reply-destination="replyQueueB"
	                              connection-factory="jmsConnectionFactory"
	                              receive-timeout="100000"
	                              reply-timeout="200000"/>
	</int:chain>

	<int:chain id="chain2" input-channel="chainWithGatewayInMiddle">
		<int-jms:outbound-gateway id="gateway"
	                              request-destination="requestQueueA"
	                              reply-destination="replyQueueB"
	                              connection-factory="jmsConnectionFactory"
	                              receive-timeout="100000"
	                              reply-timeout="200000"/>
		<int:transformer expression="payload"/>
	</int:chain>

<!-- INT-3884
	<int:chain id="invalidChain" input-channel="chainWithInvalidGatewayReplyChannel">
		<int-jms:outbound-gateway id="badChainGateway"
		                          request-destination="requestQueueA"
	                              reply-destination="replyQueueB"
	                              connection-factory="jmsConnectionFactory"
	                              receive-timeout="100000"
	                              reply-channel="badOutputChannel"
	                              reply-timeout="200000"/>
	</int:chain>

	<int:channel id="badOutputChannel"/>
-->
	<bean id="requestQueueA" class="org.apache.activemq.artemis.jms.client.ActiveMQQueue">
		<constructor-arg value="request.queueA"/>
	</bean>

	<bean id="replyQueueB" class="org.apache.activemq.artemis.jms.client.ActiveMQQueue">
		<constructor-arg value="reply.queueB"/>
	</bean>

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

	<int-jms:inbound-gateway id="inboundGateway" request-channel="jmsInput" request-destination="requestQueueA"/>

	<int:channel id="jmsInput"/>

<!--	<int:service-activator input-channel="jmsInput">-->
<!--		<bean class="org.springframework.integration.jms.config.JmsOutboundGatewayParserTests$SampleService"/>-->
<!--	</int:service-activator>-->
</beans>
