Change-Id: I3dac0d3785f093c095f50799890744919edb1891 Former-commit-id: 99cf68672dcfbf23c89531279cb4fcd1254b0703
154 lines
5.8 KiB
XML
154 lines
5.8 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="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&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>
|
|
|
|
<!-- Begin Grib Routes -->
|
|
<route id="gribIngestRoute">
|
|
<from uri="ingest-grib:queue:Ingest.Grib?concurrentConsumers=4&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&showBody=false&showCaughtException=true&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>
|