awips2/edexOsgi/com.raytheon.uf.edex.plugin.modelsounding/res/spring/modelsounding-ingest.xml
2022-05-05 12:34:50 -05:00

69 lines
2.9 KiB
XML

<beans xmlns="http://www.springframework.org/schema/beans"
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.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd">
<bean id="modelsoundingPersistenceManager"
class="com.raytheon.uf.edex.plugin.modelsounding.ModelSoundingPersistenceManager">
</bean>
<bean id="modelsoundingDecoder"
class="com.raytheon.uf.edex.plugin.modelsounding.ModelSoundingDecoder">
<property name="modelSoundingPersistenceManager" ref="modelsoundingPersistenceManager" />
</bean>
<bean id="mdlsndgDistRegistry" factory-bean="distributionSrv"
factory-method="register">
<constructor-arg ref="modelsoundingPluginName" />
<constructor-arg value="jms-durable:queue:Ingest.modelsounding"/>
</bean>
<bean factory-bean="contextManager" factory-method="registerContextStateProcessor">
<constructor-arg ref="modelsounding-camel"/>
<constructor-arg ref="modelsoundingPersistenceManager"/>
</bean>
<camelContext id="modelsounding-camel"
xmlns="http://camel.apache.org/schema/spring"
errorHandlerRef="errorHandler">
<!-- Begin Model Sounding routes -->
<route id="modelsndgIngestRoute">
<from uri="jms-durable:queue:Ingest.modelsounding"/>
<setHeader name="pluginName">
<constant>modelsounding</constant>
</setHeader>
<doTry>
<pipeline>
<bean ref="stringToFile" />
<bean ref="modelsoundingDecoder" method="decode"/>
<!-- model sounding decoder has dedicated store thread, only need to forward to log -->
<bean ref="processUtil" method="log"/>
</pipeline>
<doCatch>
<exception>java.lang.Throwable</exception>
<to uri="log:modelsounding?level=ERROR"/>
</doCatch>
</doTry>
</route>
<!-- Thread runs for life of context -->
<route id="modelSoundingPersistThread">
<from uri="timer://modelSoundingPersistenceManager?repeatCount=1"/>
<bean ref="modelsoundingPersistenceManager" method="run"/>
</route>
<!--
Copy of persist route without the log call.
This route must come after the timer route for proper startup/shutdown order.
-->
<route id="modelSoundingPersistIndexAlert">
<from uri="direct:modelSoundingPersistIndexAlert"/>
<bean ref="persist" method="persist"/>
<bean ref="index" method="index"/>
<to uri="direct-vm:stageNotification"/>
</route>
</camelContext>
</beans>