Spring Integration Outbound File Adapter -
i'm kind of having issues on implementing functionality , i'm noticing inconsistencies when drop files.
1) when drop multiple files, not files transferred correct directory.
2) service activator hits before file transfer happens outbound adapter.
3) stalls .moving.
a) looking @ code below, correctly setup?
b) how can make sure source files deleted before service activator hits.
c) transactional code necessary?
<!-- adapter reading files in incoming directory --> <int-file:inbound-channel-adapter id="incomingfileadapter" channel="fileinputchannel" prevent-duplicates="false" scanner="recursivedirectoryscanner" filename-regex="^.*\.(?i)(avi|divx|xvid|flv|f4v|mkv|m1v|m2v|m4v|mpeg|mpg|mp4|mov|vob|wmv|asf|ts|mxf)$" directory="${file.listener.path.incoming}"> <int:poller id="filepoller" default="true" max-messages-per-poll="5" fixed-rate="5000"> <int:transactional transaction-manager="pseudotransactionmanager" /> </int:poller> </int-file:inbound-channel-adapter> <!-- adapter writing files processed directory --> <int-file:outbound-channel-adapter id="processedfileadapter" mode="replace" channel="fileinputchannel" delete-source-files="true" auto-create-directory="true" order="1" directory-expression="@dynamicdirectorygenerator.generatedirectory(payload)" /> <int:service-activator input-channel="fileinputchannel" output-channel="nullchannel" order="2" ref="fileinputactivator" method="processmessage"/> <bean id="fileinputactivator" class="com.nfl.dm.shield.ingestion.file.activator.fileinputactivator" /> <bean id="recursivedirectoryscanner" class="org.springframework.integration.file.recursiveleafonlydirectoryscanner" /> <bean id="dynamicdirectorygenerator" class="com.nfl.dm.shield.ingestion.file.dynamic.dynamicdirectorygenerator" /> <bean id="pseudotransactionmanager" class="org.springframework.integration.transaction.pseudotransactionmanager" />
a) since don't have declaration fileinputchannel
, it's directchanel
means messages alternately go outbound adapter , service activator.
declare <publish-subscribe-channel/>
, each file go both subscribers (based on order
).
b) it's not clear mean since want send file service, why want deleted before gets there? if mean can add <request-handler-advice-chain/>
file adapter expressionevaluatingrequesthandleradvice. see retry-and-more sample example of how use advice.
c) no, pseudo transaction not necessary since not taking action on success or failure.
Comments
Post a Comment