awips2/edexOsgi/com.raytheon.edex.plugin.grib/res/spring/grib-decode.xml
Ben Steffensmeier 51cd71c373 Issue #2473 Remove unneeded ncgrib functionality.
Change-Id: If38138650660c75745091a82c231cd0fe8c92e38

Former-commit-id: 49a3700d37c07f42991f7ca4a65f0fd4c7010f91
2013-10-15 16:30:38 -05:00

102 lines
3.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-3.1.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<bean id="gribDecoder" class="com.raytheon.edex.plugin.grib.GribDecoder" />
<bean id="ingest-grib" class="org.apache.camel.component.jms.JmsComponent">
<constructor-arg ref="jmsGribConfig" />
<property name="taskExecutor" ref="gribThreadPool" />
</bean>
<bean id="jmsGribConfig" class="org.apache.camel.component.jms.JmsConfiguration"
factory-bean="jmsDurableConfig" factory-method="copy"/>
<bean id="gribThreadPool"
class="com.raytheon.uf.edex.esb.camel.spring.JmsThreadPoolTaskExecutor">
<property name="corePoolSize" value="${grib-decode.count.threads}" />
<property name="maxPoolSize" value="${grib-decode.count.threads}" />
</bean>
<bean id="gribGridPointLock" class="com.raytheon.edex.plugin.grib.GribGridPointLock">
<constructor-arg value="${grib-decode.count.gridpoints}"/>
<constructor-arg value="${grib-decode.count.threads}"/>
</bean>
<bean id="gribSplitter" class="com.raytheon.edex.plugin.grib.GribSplitter" />
<bean id="useLatestAggregationStrategy" class="org.apache.camel.processor.aggregate.UseLatestAggregationStrategy" />
<bean id="gribDecodeCamelRegistered" factory-bean="contextManager"
factory-method="register" depends-on="persistCamelRegistered">
<constructor-arg ref="grib-decode"/>
</bean>
<bean id="gribPostProcessor"
class="com.raytheon.edex.plugin.grib.decoderpostprocessors.GribPostProcessor"
factory-method="getInstance" />
<bean id="gribTableLookup" class="com.raytheon.edex.util.grib.GribTableLookup"
factory-method="getInstance" depends-on="gridRegistered" />
<bean id="gribModelLookup"
class="com.raytheon.edex.plugin.grib.util.GribModelLookup"
factory-method="getInstance" />
<bean id="gribSpatialCache"
class="com.raytheon.edex.plugin.grib.spatial.GribSpatialCache"
factory-method="getInstance" depends-on="gridcoveragelookup"/>
<camelContext id="grib-decode" xmlns="http://camel.apache.org/schema/spring"
errorHandlerRef="errorHandler"
autoStartup="false">
<endpoint id="gribSplitJmsEndpoint" uri="jms-durable:queue:Ingest.GribSplit?concurrentConsumers=${grib-split.count.threads}"/>
<endpoint id="gribDecodeJmsEndpoint" uri="ingest-grib:queue:Ingest.GribDecode?concurrentConsumers=${grib-decode.count.threads}"/>
<!-- Begin Grib Decode Route -->
<route id="gribSplitIngestRoute">
<from ref="gribSplitJmsEndpoint" />
<doTry>
<pipeline>
<setHeader headerName="pluginName">
<constant>grid</constant>
</setHeader>
<bean ref="stringToFile" />
<!-- strategyRef is needed because of camel bug https://issues.apache.org/activemq/browse/CAMEL-3333,
without the strategy it uses the original message in the multicast and it loses the largeFileLock header -->
<split strategyRef="useLatestAggregationStrategy">
<method bean="gribSplitter" method="split" />
<to uri="jms-durable:queue:Ingest.GribDecode" />
</split>
</pipeline>
<doCatch>
<exception>java.lang.Throwable</exception>
<to uri="log:grib?level=ERROR"/>
</doCatch>
</doTry>
</route>
<route id="gribDecodeIngestRoute">
<from ref="gribDecodeJmsEndpoint" />
<doTry>
<pipeline>
<bean ref="gribGridPointLock" method="reserve"/>
<bean ref="gribDecoder" />
<!-- send for processing -->
<bean ref="gribPostProcessor" method="process" />
<to uri="direct-vm:persistIndexAlert" />
</pipeline>
<doCatch>
<exception>java.lang.Throwable</exception>
<to uri="log:grib?level=ERROR"/>
</doCatch>
<doFinally>
<bean ref="gribGridPointLock" method="release"/>
</doFinally>
</doTry>
</route>
</camelContext>
</beans>