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

53 lines
2.2 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="fileChangedStrategy" class="com.raytheon.uf.edex.esb.camel.FileChangedExclusiveReadLockStrategy">
<constructor-arg value="${manualIngest.minFileAge}" />
</bean>
<bean id="inProgressRepository" class="org.apache.camel.support.processor.idempotent.MemoryIdempotentRepository" factory-method="memoryIdempotentRepository">
<constructor-arg value="${manualIngest.inProgressCacheSize}" />
</bean>
<camelContext id="clusteredManualProc"
xmlns="http://camel.apache.org/schema/spring"
errorHandlerRef="errorHandler">
<endpoint id="manualFileEndpoint"
uri="file:${manualIngest.dropBoxPath}?
delay=${manualIngest.delay}&amp;
useFixedDelay=false&amp;
maxMessagesPerPoll=${manualIngest.maxMessagesPerPoll}&amp;
noop=true&amp;
idempotent=false&amp;
exclusiveReadLockStrategy=#fileChangedStrategy&amp;
inProgressRepository=#inProgressRepository&amp;
recursive=true"/>
<endpoint id="manualIngest"
uri="vm:manualIngestQueue?
size=${manualIngest.vmQueueSize}&amp;
concurrentConsumers=${manualIngest.threads}&amp;
blockWhenFull=true" />
<route id="manualFileScan">
<from uri="manualFileEndpoint" />
<to uri="manualIngest" />
</route>
<route id="manualIngestRoute">
<from uri="manualIngest"/>
<bean ref="manualProc" method="moveFileToArchive"/>
<bean ref="manualProc" />
<to uri="jms-durable:queue:external.dropbox"/>
</route>
</camelContext>
<bean factory-bean="contextManager" factory-method="registerClusteredContext">
<constructor-arg ref="clusteredManualProc" />
</bean>
</beans>