Announcement Announcement Module
No announcement yet.
File outbound channel adapter nested folders Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • File outbound channel adapter nested folders

    I have a requirement wherein i read files using inbound channel adapter, convert it to string using string transformer and then have to move the file to a separate location. I configured a service activator to call a outbound channel and write files to destination folder. Code snippet:
    <file:inbound-channel-adapter channel="filesIn" directory="#[fileserver.input.path]" scanner="myScanner" filter="fileFilter"/>
    <file:file-to-string-transformer input-channel="filesIn" output-channel="stringTransformer" delete-files="false" charset="UTF-8" />
    <service-activator input-channel="stringTransformer" output-channel="filesOut" ref="handler"/>
    <beans:bean id="handler" class="...Handler"/>
    <file:outbound-channel-adapter id="filesOut" directory="#[fileserver.output.path]" delete-source-files="true"/>
    <channel id="filesIn" />
    <channel id="stringTransformer" />
    I have the following issues"
    1) The source directory has nested folder structure and i want the same folder structure to be followed in destination folder also.
    Eg. I have files like C:/Input/A/a.txt, C:/Input/B/b.txt. The code creates files like C:/Output/a.txt and C:/Output/b.txt
    2) I want the outbound channel to be called after a lag. The file processing takes some time say 2 minutes and I dont want the files to be moved instantly. But with the current implementation, the files are moved instantly and processing stops.

    Expecting early reply,