<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:amq="http://activemq.apache.org/schema/core"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
	xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
	<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE"/>
	</bean>

	<bean id="cdsAppName" class="java.lang.String">
		<constructor-arg value="${cdsAppName}" />
	</bean>
	
	<bean id="pathwaysAppName" class="java.lang.String">
		<constructor-arg value="${pathwaysAppName}" />
	</bean>

	<!-- JMS ConnectionFactory to use, configuring the embedded broker using XML -->
	<amq:connectionFactory id="jmsConnectionFactory" brokerURL="vm://localhost"/>

	<!--  ActiveMQ destinations to use  -->
	<amq:queue id="readAuditQueue" physicalName="org.apache.activemq.spring.Test.spring.embedded"/>
	<bean id="readMessagesAuditJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
		<property name="connectionFactory" ref="jmsConnectionFactory"/>
		<property name="receiveTimeout" value="10000"/>
		<property name="defaultDestination" ref="readAuditQueue"/>
	</bean>
	
	<amq:queue id="readPathwaysAuditQueue" physicalName="org.apache.activemq.spring.Test.spring.embedded"/>
	<bean id="readRpcMessagesAuditJmsTemplate" class="org.springframework.jms.core.JmsTemplate">
        <property name="connectionFactory" ref="jmsConnectionFactory"/>
        <property name="receiveTimeout" value="10000"/>
        <property name="defaultDestination" ref="readPathwaysAuditQueue"/>
    </bean>
    
	<bean id="auditLogPersistenceManager" class="gov.va.med.cds.audit.persistence.jms.JmsAuditLogPersistenceManager">
		<property name="readMessagesAuditJmsTemplate" ref="readMessagesAuditJmsTemplate"/>
		<property name="appName" ref="cdsAppName" />
	</bean>
	
	<bean id="rpcAuditLogPersistenceManager" class="gov.va.med.cds.audit.persistence.jms.JmsAuditLogPersistenceManager">
		<property name="readMessagesAuditJmsTemplate" ref="readRpcMessagesAuditJmsTemplate"/>
		<property name="appName" ref="pathwaysAppName" />
	</bean>
	<!-- Spring JMS Configuration end -->

	<!-- JMS Server and JMS Templates required for tests -->
	<amq:broker useJmx="false" persistent="false">
		<amq:transportConnectors>
			<amq:transportConnector uri="tcp://localhost:0"/>
		</amq:transportConnectors>
	</amq:broker>
</beans>