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

	<int:gateway id="brkenBrokerGateway" default-request-channel="outGatewayInChannel"/>

	<int-jms:outbound-gateway id="jog" request-channel="outGatewayInChannel"
	    connection-factory="jmsConnectionFactory"
		request-destination-name="brokenBrokerRequestQueue"
		correlation-key="JMSCorrelationID"
		receive-timeout="1000"/>

	<int-jms:inbound-gateway request-channel="jmsInChannel"
						     request-destination-name="brokenBrokerRequestQueue"
							 connection-factory="jmsConnectionFactory"
							 concurrent-consumers="10"
							 reply-timeout="10000"/>

	<int:channel id="jmsInChannel">
		<int:dispatcher task-executor="executor"/>
	</int:channel>

	<int:service-activator input-channel="jmsInChannel" expression="payload"/>

	<bean id="jmsConnectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
		<property name="targetConnectionFactory">
			<bean class="org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory">
				<property name="brokerURL" value="tcp://localhost:61623"/>
			</bean>
		</property>
		<property name="cacheProducers" value="true" />
		<property name="cacheConsumers" value="true" />
		<property name="sessionCacheSize" value="10" />
	</bean>

	<task:executor id="executor" pool-size="20"/>
</beans>
