awips2/edexOsgi/com.raytheon.edex.plugin.grib/res/spring/grib-ingest.xml
Dustin Johnson 8e69107b5a Issue #1302 Merge branch '5-Data_Delivery' into development
Conflicts:
    edexOsgi/build.edex/deploy-common/external-rules.xml
    edexOsgi/build.edex/deploy-common/plugin-methods.xml
    edexOsgi/com.raytheon.edex.plugin.text/src/com/raytheon/edex/plugin/text/dao/TextDao.java
    edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/plugin/PluginDao.java
    edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/Executor.java
    edexOsgi/build.edex/build.xml
    edexOsgi/build.edex/esb/conf/modes.xml
    edexOsgi/com.raytheon.edex.feature.uframe/feature.xml
    edexOsgi/com.raytheon.edex.plugin.grib/res/spring/grib-ingest.xml
    edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/Grib1Decoder.java
    edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/GribDecoder.java
    edexOsgi/com.raytheon.uf.common.gridcoverage/src/com/raytheon/uf/common/gridcoverage/GridCoverage.java

Change-Id: I32226e8c316eb393d6f372eaa53b8811d0a954a0

Former-commit-id: 31d7d09c10 [formerly 89583d97c8823818f87dc1a234078d85ba7bea4a]
Former-commit-id: 98d7beae50
2012-11-01 13:36:06 -05:00

166 lines
6.3 KiB
XML

<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">
<!-- Done to force instantiation of the GribTables -->
<bean id="gribTableLookup" class="com.raytheon.edex.util.grib.GribTableLookup"
factory-method="getInstance" depends-on="gridRegistered" />
<bean id="gribNotifyQueue"
class="com.raytheon.edex.plugin.grib.notify.GribNotifyQueue">
<property name="destinationUri" value="jms-generic:queue:gribNotification"/>
</bean>
<bean id="gribDecoder" class="com.raytheon.edex.plugin.grib.GribDecoder" />
<bean id="gribSpatialCache"
class="com.raytheon.edex.plugin.grib.spatial.GribSpatialCache"
factory-method="getInstance" depends-on="gridcoveragelookup"/>
<bean id="gribModelLookup"
class="com.raytheon.edex.plugin.grib.util.GribModelLookup"
factory-method="getInstance" />
<bean id="gribPostProcessor"
class="com.raytheon.edex.plugin.grib.decoderpostprocessors.GribPostProcessor"
factory-method="getInstance" />
<bean id="gribStaticDataGenerator"
class="com.raytheon.edex.plugin.grib.topo.StaticDataGenerator"
factory-method="getInstance"/>
<bean id="ingest-grib" class="org.apache.camel.component.jms.JmsComponent">
<constructor-arg ref="jmsIngestGribConfig" />
<property name="taskExecutor" ref="gribThreadPool" />
</bean>
<bean id="jmsIngestGribConfig" class="org.apache.camel.component.jms.JmsConfiguration"
factory-bean="jmsConfig" factory-method="copy">
</bean>
<bean id="gribThreadPool"
class="com.raytheon.uf.edex.esb.camel.spring.JmsThreadPoolTaskExecutor">
<property name="corePoolSize" value="4" />
<property name="maxPoolSize" value="4" />
</bean>
<bean id="largeFileChecker" class="com.raytheon.edex.plugin.grib.GribLargeFileChecker" />
<bean id="ncgribTestProcessor" class="com.raytheon.edex.plugin.grib.NcgribTestProcessor" />
<bean id="gribSplitter" class="com.raytheon.edex.plugin.grib.GribSplitter">
<constructor-arg value="${edex.home}/data/tmp/"/>
</bean>
<bean id="useLatestAggregationStrategy" class="org.apache.camel.processor.aggregate.UseLatestAggregationStrategy" />
<bean id="largeFileLockRelease" class="com.raytheon.edex.plugin.grib.GribLockRelease" />
<bean id="gribCamelRegistered" factory-bean="contextManager"
factory-method="register" depends-on="persistCamelRegistered">
<constructor-arg ref="grib-camel"/>
</bean>
<bean id="gridToGribConverter"
class="com.raytheon.edex.plugin.grib.GridToGribConverter" factory-method="getInstance" />
<camelContext id="grib-camel" xmlns="http://camel.apache.org/schema/spring"
errorHandlerRef="errorHandler"
autoStartup="false">
<endpoint id="gribFileEndpoint" uri="file:${edex.home}/data/sbn/grib?noop=true&amp;idempotent=false" />
<endpoint id="ncgribTestFileEndpoint" uri="file:${edex.home}/data/sbn/ncgribTest?noop=true&amp;idempotent=false" />
<route id="gribFileConsumerRoute">
<from ref="gribFileEndpoint" />
<bean ref="fileToString" />
<setHeader headerName="pluginName">
<constant>grid</constant>
</setHeader>
<to uri="ingest-grib:queue:Ingest.Grib" />
</route>
<route id="ncgribTestFileConsumerRoute">
<from ref="ncgribTestFileEndpoint" />
<bean ref="fileToString" />
<bean ref="ncgribTestProcessor" />
<setHeader headerName="pluginName">
<constant>grid</constant>
</setHeader>
<to uri="ingest-grib:queue:Ingest.Grib" />
</route>
<!-- Begin Grib Routes -->
<route id="gribIngestRoute">
<from uri="ingest-grib:queue:Ingest.Grib?concurrentConsumers=4&amp;destinationResolver=#qpidDurableResolver" />
<setHeader headerName="pluginName">
<constant>grid</constant>
</setHeader>
<!-- 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" />
<choice>
<when>
<simple>${header.CamelSplitSize} == 1</simple>
<doTry>
<pipeline>
<bean ref="stringToFile" />
<bean ref="largeFileChecker" />
<bean ref="gribDecoder" method="decode" />
<bean ref="gribSplitter" method="clean" />
<bean ref="gribPostProcessor" method="process" />
<bean ref="persist" method="persist" />
<bean ref="index" method="index" />
<bean ref="processUtil" method="log" />
<multicast parallelProcessing="false">
<to uri="directvm:gribIngestAlert"/>
<to uri="directvm:gribNotification"/>
<to uri="vm:staticTopoGenerator"/>
<to uri="directvm:gridToGrib"/>
</multicast>
</pipeline>
<doCatch>
<exception>java.lang.Throwable</exception>
<to uri="log:grib?level=ERROR&amp;showBody=false&amp;showCaughtException=true&amp;showStackTrace=true"/>
</doCatch>
<doFinally>
<bean ref="largeFileLockRelease" />
</doFinally>
</doTry>
</when>
<otherwise>
<to uri="ingest-grib:queue:Ingest.Grib" />
</otherwise>
</choice>
</split>
</route>
<route id="gribIngestAlert">
<from uri="directvm:gribIngestAlert" />
<bean ref="toDataURI" method="toDataURI" />
<to uri="vm:stageNotification" />
</route>
<route id="gribNotification">
<from uri="directvm:gribNotification"/>
<bean ref="gribNotifyQueue" method="addRecords"/>
</route>
<route id="gridToGrib">
<from uri="directvm:gridToGrib"/>
<bean ref="gridToGribConverter" method="convert"/>
<to uri="directvm:indexAlert" />
</route>
<route id="gribStaticTopoGen">
<from uri="vm:staticTopoGenerator" />
<!-- genStaticTopoRecords stores to hdf5 and the database as part of method -->
<bean ref="gribStaticDataGenerator"/>
<multicast parallelProcessing="false">
<to uri="directvm:gribIngestAlert"/>
<to uri="directvm:gribNotification"/>
</multicast>
</route>
</camelContext>
</beans>