<?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"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
  http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd   
  http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">	
	
	<bean id="manualDecoder" class="com.raytheon.edex.plugin.ldadmanual.dao.ManualDecoder">
		<constructor-arg ref="manualPluginName" />
	</bean>
	<bean id="manualDatabase" class="java.lang.String">
		<constructor-arg type="java.lang.String" value="metadata" />
	</bean>

	<bean id="ldadmanualDistRegistry" factory-bean="distributionSrv"
		factory-method="register">
		<constructor-arg value="ldadmanual" />
		<constructor-arg value="jms-dist:queue:Ingest.ldadmanual?destinationResolver=#qpidDurableResolver" />
	</bean>	

    <bean id="ldadmanualCamelRegistered" factory-bean="contextManager"
		factory-method="register" depends-on="persistCamelRegistered">
		<constructor-arg ref="ldadmanual-camel"/>
  	</bean>

	<camelContext id="ldadmanual-camel"
		xmlns="http://camel.apache.org/schema/spring"
		errorHandlerRef="errorHandler"
		autoStartup="false">

		<route id="ldadmanualIngestRoute">
			<from uri="jms-generic:queue:Ingest.ldadmanual?destinationResolver=#qpidDurableResolver" />
			<doTry>
				<pipeline>
					<bean ref="stringToFile" />
					<bean ref="manualDecoder" method="decode" />
					<to uri="directvm:indexAlert" />
				</pipeline>
				<doCatch>
					<exception>java.lang.Throwable</exception>
					<to uri="log:ldadmanual?level=ERROR&amp;showBody=false&amp;showCaughtException=true&amp;showStackTrace=true"/>
				</doCatch>
			</doTry>
		</route>
	</camelContext>
</beans>