I created a custom MessageSource to craft up a Message. The Message payload contains 2 files from a network drive (a data file and a control file).
I am using a SourcePollingChannelAdapter with has my custom MessageSource injected as a source. All is working well at the moment.
One thing I noticed is that I can inject a self defined taskExecutor into my SourcePollingChannelAdapter.
My question is - is there any way I can inject some file locking (like nio-locker)?
Here's my bean config:
<bean id="tradeFeedMessageSource" class="com.cjansen.tradeFeedIntegrator.file.TradeF eedFileReadingMessageSource">
<property name="directory" value="${rawSourceFile.directory}"/>
<property name="filter" ref= "compositeControlFileFilter"/>
<property name="scanEachPoll" value="true"/>
<property name="controlFileExtension" value=".cntl"/>
</bean>
<task:executor id="rawDataFileExecutor" pool-size="10"/>
<bean id="tradeFeedFileAdapter" class="org.springframework.integration.endpoint.So urcePollingChannelAdapter" >
<property name="outputChannel" ref="rawDataFileChannel"/>
<property name="source" ref="tradeFeedMessageSource"/>
<property name="maxMessagesPerPoll" value="1"/>
<property name="taskExecutor" ref="rawDataFileExecutor"/>
</bean>


Reply With Quote